:root {
  color-scheme: dark;
  --ink: #f7f3e8;
  --muted: #a8b0bd;
  --soft: #d4dde8;
  --line: rgba(255, 255, 255, 0.14);
  --line-strong: rgba(255, 255, 255, 0.24);
  --panel: rgba(18, 24, 36, 0.86);
  --panel-solid: #121824;
  --panel-2: #1b2534;
  --wash: #080b12;
  --coral: #ff6b5e;
  --cyan: #42d7df;
  --lime: #9be15d;
  --amber: #ffbf47;
  --violet: #a78bfa;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.42);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  background: var(--wash);
}

body {
  min-width: 320px;
  margin: 0;
  background:
    radial-gradient(circle at 14% 8%, rgba(66, 215, 223, 0.18), transparent 28rem),
    radial-gradient(circle at 84% 0%, rgba(255, 107, 94, 0.18), transparent 26rem),
    linear-gradient(135deg, #080b12 0%, #101622 42%, #171320 100%);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.72), transparent 76%);
  content: "";
}

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

button,
input,
select {
  font: inherit;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 76px;
  padding: 14px clamp(18px, 4vw, 52px);
  border-bottom: 1px solid var(--line);
  background: rgba(8, 11, 18, 0.82);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: max-content;
  color: #fff;
  font-weight: 900;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  background: linear-gradient(135deg, var(--coral), var(--cyan));
  color: #081019;
  font-size: 14px;
  font-weight: 950;
  box-shadow: 0 12px 34px rgba(66, 215, 223, 0.18);
}

.search {
  flex: 1;
  max-width: 500px;
}

.search input,
select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink);
  outline: none;
}

.search input {
  padding: 0 16px;
}

.search input::placeholder {
  color: rgba(247, 243, 232, 0.54);
}

.search input:focus,
select:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 4px rgba(66, 215, 223, 0.14);
}

select {
  max-width: 172px;
  padding: 0 12px;
  background-color: #121824;
}

.filter-menu-button {
  display: none;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink);
  cursor: pointer;
}

.filter-menu-button svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.home-page {
  display: grid;
  grid-template-columns: minmax(190px, 240px) minmax(0, 1fr);
  gap: clamp(18px, 3vw, 36px);
  width: min(1560px, 100%);
  margin: 0 auto;
  padding: 28px clamp(18px, 4vw, 52px) 54px;
}

.home-shell,
.category-page {
  min-width: 0;
}

.category-page {
  width: min(1480px, 100%);
  margin: 0 auto;
  padding: 32px clamp(18px, 4vw, 52px) 54px;
}

.filters {
  position: sticky;
  top: 84px;
  align-self: start;
  display: grid;
  gap: 16px;
  min-width: 0;
  max-height: calc(100vh - 104px);
  overflow: auto;
}

.filters.mobile-category-menu {
  display: grid;
}

.filter-section {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(18, 24, 36, 0.62);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.22);
}

.filter-heading {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-height: 50px;
  border: 0;
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--soft);
  cursor: default;
  font-size: 12px;
  font-weight: 900;
  text-align: left;
  text-transform: uppercase;
}

.filter-heading svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  fill: currentColor;
}

.filter-heading .chevron {
  display: none;
  margin-left: auto;
  transition: transform 160ms ease;
}

.filter-heading[aria-expanded="true"] .chevron {
  transform: rotate(180deg);
}

.filter-panel {
  display: grid;
  gap: 8px;
  padding: 12px;
}

.filter-panel[hidden] {
  display: none;
}

.filter-panel.compact {
  display: flex;
  flex-wrap: wrap;
}

.filter-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.filter-panel.compact .filter-button {
  width: auto;
  border-color: var(--line);
}

.filter-button:hover,
.filter-button.active {
  border-color: rgba(66, 215, 223, 0.54);
  background: rgba(66, 215, 223, 0.12);
  color: #fff;
}

.home-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(320px, 0.96fr);
  gap: clamp(18px, 4vw, 52px);
  min-height: 280px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: clamp(18px, 4vw, 36px);
  background:
    linear-gradient(135deg, rgba(255, 107, 94, 0.16), transparent 42%),
    linear-gradient(315deg, rgba(66, 215, 223, 0.16), transparent 42%),
    rgba(18, 24, 36, 0.72);
  box-shadow: var(--shadow);
}

.home-hero::after {
  position: absolute;
  right: 12%;
  bottom: -1px;
  left: 12%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--cyan), var(--coral), transparent);
  content: "";
}

.hero-copy {
  position: relative;
  z-index: 1;
  display: grid;
  align-content: center;
  gap: 18px;
}

.eyebrow {
  margin: 0;
  color: var(--cyan);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(38px, 6vw, 88px);
  line-height: 0.92;
  letter-spacing: 0;
}

.home-hero h1 {
  font-size: clamp(30px, 5vw, 64px);
  line-height: 1;
}

.hero-copy p {
  max-width: 620px;
  margin: 0;
  color: var(--soft);
  font-size: clamp(16px, 2vw, 20px);
  line-height: 1.55;
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

.hero-stats span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--muted);
}

.hero-stats strong {
  color: #fff;
  font-size: 18px;
}

.hero-board {
  position: relative;
  min-height: 220px;
}

.hero-token {
  position: absolute;
  display: block;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  background: #0f1520;
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.36);
}

.hero-token-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: linear-gradient(135deg, var(--coral), var(--cyan) 52%, var(--lime));
}

.token-1 {
  top: 12%;
  left: 20%;
  width: min(42%, 180px);
  aspect-ratio: 1;
  transform: rotate(-8deg);
}

.token-2 {
  top: 3%;
  right: 9%;
  width: min(31%, 132px);
  aspect-ratio: 1;
  transform: rotate(9deg);
}

.token-3 {
  right: 20%;
  bottom: 4%;
  width: min(38%, 162px);
  aspect-ratio: 1;
  transform: rotate(6deg);
}

.token-4 {
  bottom: 16%;
  left: 0;
  width: min(29%, 124px);
  aspect-ratio: 1;
  transform: rotate(12deg);
}

.token-5 {
  top: 45%;
  right: 0;
  width: min(24%, 104px);
  aspect-ratio: 1;
  transform: rotate(-12deg);
}

.token-6,
.token-7 {
  display: none;
}

.featured-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
  margin: 22px 0 32px;
}

.feature-card,
.game-card,
.game-info,
.player-panel {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.24);
}

.feature-card {
  display: grid;
  grid-template-columns: 116px minmax(0, 1fr);
  min-height: 132px;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.feature-card:hover,
.game-card:hover {
  transform: translateY(-4px);
  border-color: var(--line-strong);
  background: rgba(25, 34, 49, 0.94);
}

.thumb,
.game-info img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: linear-gradient(135deg, var(--coral), var(--cyan) 52%, var(--lime));
}

.feature-card .content,
.game-card .content {
  min-width: 0;
  padding: 14px;
}

.feature-card h2,
.game-card h2 {
  overflow: hidden;
  margin: 0 0 9px;
  color: #fff;
  font-size: 17px;
  line-height: 1.15;
  letter-spacing: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.feature-card p,
.game-card p {
  display: -webkit-box;
  overflow: hidden;
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.category-sections {
  display: grid;
  gap: 38px;
}

.category-block {
  min-width: 0;
}

.section-topline,
.catalog-topline {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
}

.section-topline {
  margin-bottom: 14px;
}

.catalog-topline {
  margin-bottom: 24px;
}

.section-topline h2 {
  margin: 0;
  color: #fff;
  font-size: clamp(24px, 3vw, 38px);
  line-height: 1;
}

.more-link,
.header-link,
.back-link,
.primary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border: 1px solid rgba(66, 215, 223, 0.48);
  border-radius: 8px;
  padding: 0 14px;
  background: rgba(66, 215, 223, 0.1);
  color: #dffcff;
  font-weight: 900;
}

.more-link:hover,
.header-link:hover,
.back-link:hover,
.primary-link:hover {
  background: var(--cyan);
  color: #071014;
}

.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(174px, 1fr));
  gap: 16px;
}

.category-preview-grid {
  grid-template-columns: repeat(auto-fill, minmax(154px, 1fr));
}

.game-card {
  display: flex;
  min-height: 292px;
  flex-direction: column;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.game-card .media {
  aspect-ratio: 1;
  overflow: hidden;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
}

.badge {
  display: inline-flex;
  max-width: 100%;
  align-items: center;
  min-height: 24px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  padding: 2px 8px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--soft);
  font-size: 12px;
  font-weight: 800;
  text-transform: capitalize;
}

.badge.hot {
  background: rgba(255, 107, 94, 0.18);
  color: #ffc5bf;
}

.badge.recommend {
  background: rgba(66, 215, 223, 0.16);
  color: #bdf9ff;
}

.badge.popular {
  background: rgba(155, 225, 93, 0.16);
  color: #d9ffb8;
}

.rating {
  color: var(--amber);
  font-weight: 900;
}

.empty-state {
  margin: 48px 0;
  color: var(--muted);
  font-size: 18px;
}

.load-more-wrap {
  display: flex;
  justify-content: center;
  padding: 28px 0 6px;
}

.load-more,
.play-button {
  min-width: 148px;
  min-height: 46px;
  border: 0;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--coral), var(--amber));
  color: #170c09;
  cursor: pointer;
  font-weight: 950;
  box-shadow: 0 14px 34px rgba(255, 107, 94, 0.24);
}

.load-more:hover,
.play-button:hover {
  transform: translateY(-1px);
}

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

.detail-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 380px);
  gap: 22px;
  min-height: calc(100vh - 76px);
  padding: 24px clamp(18px, 4vw, 52px) 38px;
}

.player-panel {
  display: flex;
  min-width: 0;
  min-height: 650px;
  flex-direction: column;
  background: rgba(8, 11, 18, 0.82);
}

.player-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 60px;
  padding: 9px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
}

.player-actions {
  display: inline-flex;
  gap: 8px;
}

.icon-button {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink);
  cursor: pointer;
  font-size: 20px;
  font-weight: 900;
}

.icon-button:hover {
  border-color: var(--cyan);
  color: #fff;
}

.icon-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

iframe {
  width: 100%;
  flex: 1;
  min-height: 0;
  border: 0;
  background: #05070c;
}

iframe[hidden] {
  display: none;
}

.player-stage {
  position: relative;
  display: flex;
  flex: 1;
  min-height: 0;
}

.player-start {
  display: grid;
  width: 100%;
  place-items: center;
  align-content: center;
  gap: 14px;
  padding: 32px;
  background:
    linear-gradient(rgba(8, 11, 18, 0.7), rgba(8, 11, 18, 0.86)),
    linear-gradient(135deg, var(--coral), var(--cyan) 52%, var(--violet));
  color: #fff;
  text-align: center;
}

.player-start img {
  width: min(190px, 42vw);
  aspect-ratio: 1;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  object-fit: cover;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.35);
}

.player-start .eyebrow {
  margin-top: 8px;
}

.player-start h1 {
  max-width: min(780px, 100%);
  font-size: clamp(36px, 7vw, 82px);
  overflow-wrap: anywhere;
}

.play-button {
  min-height: 52px;
  padding: 0 28px;
  font-size: 18px;
}

.player-stage.playing .player-start {
  display: none;
}

.player-stage.playing iframe {
  display: block;
}

.game-info {
  align-self: start;
}

.game-info img {
  display: block;
  aspect-ratio: 1;
  height: auto;
}

.info-body {
  padding: 20px;
}

.info-body h1 {
  margin-bottom: 14px;
  font-size: clamp(28px, 4vw, 46px);
  line-height: 1;
}

#gameSynopsis {
  color: var(--muted);
  line-height: 1.65;
}

.related-games {
  border-top: 1px solid var(--line);
  padding: 16px;
}

.related-games h2 {
  margin: 0 0 12px;
  color: var(--soft);
  font-size: 13px;
  text-transform: uppercase;
}

.related-list {
  display: grid;
  gap: 10px;
}

.related-card {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 64px;
  border-radius: 8px;
}

.related-card:hover {
  background: rgba(255, 255, 255, 0.07);
}

.related-card img {
  width: 58px;
  height: 58px;
  border-radius: 8px;
  object-fit: cover;
}

.related-card strong {
  display: block;
  overflow: hidden;
  color: #fff;
  font-size: 14px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.related-card span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.not-found {
  display: grid;
  min-height: calc(100vh - 76px);
  place-content: center;
  gap: 18px;
  text-align: center;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 24px clamp(18px, 4vw, 52px);
  border-top: 1px solid var(--line);
  background: rgba(8, 11, 18, 0.42);
  color: var(--muted);
  font-size: 14px;
}

.site-footer p {
  margin: 0;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.site-footer a {
  color: var(--ink);
  font-weight: 800;
}

.legal-page {
  width: min(860px, calc(100vw - 36px));
  min-height: calc(100vh - 180px);
  margin: 0 auto;
  padding: 54px 0 70px;
}

.legal-page h1 {
  margin-bottom: 18px;
}

.legal-page h2 {
  margin: 30px 0 8px;
  color: #fff;
  font-size: 22px;
}

.legal-page p {
  color: var(--muted);
  font-size: 17px;
  line-height: 1.75;
}

.legal-page .lead {
  color: var(--ink);
  font-size: 21px;
  line-height: 1.55;
}

@media (min-width: 1280px) {
  .token-6,
  .token-7 {
    display: block;
    width: min(21%, 92px);
    aspect-ratio: 1;
  }

  .token-6 {
    top: 8%;
    left: 2%;
    transform: rotate(5deg);
  }

  .token-7 {
    right: 44%;
    bottom: 0;
    transform: rotate(-10deg);
  }
}

@media (max-width: 1020px) {
  .home-page,
  .detail-shell {
    grid-template-columns: 1fr;
  }

  .filter-menu-button {
    display: grid;
  }

  .filters {
    position: fixed;
    top: 84px;
    right: 18px;
    z-index: 20;
    display: none;
    width: min(360px, calc(100vw - 36px));
    max-height: calc(100vh - 104px);
    overflow: auto;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(12, 16, 25, 0.98);
    box-shadow: var(--shadow);
  }

  .filters.mobile-category-menu {
    display: none;
  }

  .filters.mobile-category-menu.open {
    display: grid;
  }

  .filter-heading {
    cursor: pointer;
  }

  .filter-heading .chevron {
    display: block;
  }

  .filter-panel {
    display: flex;
    flex-wrap: wrap;
  }

  .filter-button {
    width: auto;
    border-color: var(--line);
  }

  .home-hero {
    grid-template-columns: 1fr;
  }

  .hero-board {
    min-height: 250px;
  }

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

  .player-panel {
    min-height: 70vh;
  }
}

@media (max-width: 680px) {
  .site-header {
    position: static;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }

  .brand {
    grid-column: 1;
    grid-row: 1;
  }

  .filter-menu-button {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
  }

  .search {
    grid-column: 1 / -1;
    max-width: none;
  }

  .home-page,
  .category-page,
  .detail-shell {
    padding-right: 14px;
    padding-left: 14px;
  }

  .home-hero {
    min-height: 0;
    padding: 22px;
  }

  .hero-copy {
    gap: 14px;
  }

  .hero-board {
    min-height: 210px;
  }

  .hero-stats span {
    flex: 1 1 130px;
  }

  .catalog-topline {
    align-items: stretch;
    flex-direction: column;
  }

  select {
    max-width: none;
  }

  .game-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .game-card {
    min-height: 252px;
  }

  .feature-card {
    grid-template-columns: 96px minmax(0, 1fr);
  }

  .site-footer {
    align-items: center;
    flex-direction: column;
    text-align: center;
  }

  .site-footer nav {
    justify-content: center;
  }
}

@media (max-width: 420px) {
  .brand {
    min-width: 0;
  }

  .brand [data-site-name] {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  h1 {
    font-size: 37px;
  }

  .game-card {
    min-height: 232px;
  }

  .game-card .content {
    padding: 12px;
  }

  .game-card p {
    -webkit-line-clamp: 1;
  }
}
