/* ==========================================================================
   H5Games5U — Design System
   https://h5games5u.online/
   Premium light gaming theme. Pure CSS, no framework, no runtime compiler.
   ========================================================================== */

/* ---------- Tokens ---------- */
:root {
  --h5-accent: #5b4bff;
  --h5-accent-600: #4a3ae8;
  --h5-accent-700: #3b2ec0;
  --h5-accent-soft: #eeecff;
  --h5-accent-ring: rgba(91, 75, 255, 0.28);

  --h5-ink: #0f1120;
  --h5-ink-2: #3d4160;
  --h5-muted: #767c99;
  --h5-faint: #a4a9c2;

  --h5-bg: #f6f7fc;
  --h5-surface: #ffffff;
  --h5-surface-2: #fbfbff;
  --h5-line: #e8eaf4;
  --h5-line-2: #f0f1f8;

  --h5-success: #12b76a;
  --h5-danger: #f04438;
  --h5-warn: #f79009;

  --h5-r-sm: 10px;
  --h5-r: 14px;
  --h5-r-lg: 20px;
  --h5-r-xl: 28px;
  --h5-r-pill: 999px;

  --h5-sh-xs: 0 1px 2px rgba(15, 17, 32, 0.05);
  --h5-sh-sm: 0 1px 3px rgba(15, 17, 32, 0.06), 0 4px 12px rgba(15, 17, 32, 0.05);
  --h5-sh: 0 2px 6px rgba(15, 17, 32, 0.05), 0 12px 28px rgba(15, 17, 32, 0.07);
  --h5-sh-lg: 0 4px 12px rgba(15, 17, 32, 0.06), 0 24px 48px rgba(15, 17, 32, 0.1);
  --h5-sh-accent: 0 8px 22px rgba(91, 75, 255, 0.28);

  --h5-header-h: 64px;
  --h5-rail-w: 236px;
  --h5-max: 1680px;

  --h5-ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --h5-font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, "Noto Sans", sans-serif;
}

/* ---------- Reset ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--h5-font);
  font-size: 15px;
  line-height: 1.6;
  color: var(--h5-ink);
  background: var(--h5-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img, svg, video, iframe { display: block; max-width: 100%; }
img { height: auto; }

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

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

button { background: none; border: 0; cursor: pointer; }

h1, h2, h3, h4, h5, h6 { margin: 0; line-height: 1.25; font-weight: 800; letter-spacing: -0.02em; }
p { margin: 0 0 1em; }
ul, ol { margin: 0; padding: 0; }

:focus-visible {
  outline: 3px solid var(--h5-accent-ring);
  outline-offset: 2px;
  border-radius: 6px;
}

::selection { background: var(--h5-accent); color: #fff; }

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

.h5-skip {
  position: absolute; left: -9999px; top: 0; z-index: 999;
  background: var(--h5-accent); color: #fff;
  padding: 12px 20px; border-radius: 0 0 var(--h5-r) 0; font-weight: 700;
}
.h5-skip:focus { left: 0; }

/* ---------- Scrollbars ---------- */
.h5-scroll-x {
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
}
.h5-scroll-x::-webkit-scrollbar { display: none; }

.h5-thin::-webkit-scrollbar { width: 8px; height: 8px; }
.h5-thin::-webkit-scrollbar-thumb { background: var(--h5-line); border-radius: 99px; }
.h5-thin::-webkit-scrollbar-thumb:hover { background: var(--h5-faint); }

/* ==========================================================================
   Shell
   ========================================================================== */

.h5-shell {
  max-width: var(--h5-max);
  margin: 0 auto;
  padding: 0 16px;
}

.h5-body {
  display: block;
  padding-bottom: 40px;
}

@media (min-width: 1100px) {
  .h5-layout {
    display: grid;
    grid-template-columns: var(--h5-rail-w) minmax(0, 1fr);
    gap: 26px;
    align-items: start;
  }
}

.h5-main { min-width: 0; }

/* ==========================================================================
   Header
   ========================================================================== */

.h5-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--h5-line);
}

.h5-header__inner {
  max-width: var(--h5-max);
  margin: 0 auto;
  padding: 0 16px;
  height: var(--h5-header-h);
  display: flex;
  align-items: center;
  gap: 14px;
}

.h5-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  font-weight: 900;
  letter-spacing: -0.035em;
  font-size: 19px;
  color: var(--h5-ink);
}
.h5-logo img { height: 34px; width: auto; border-radius: 9px; }
.h5-logo__mark {
  display: grid;
  place-items: center;
  width: 34px; height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--h5-accent), #8a6bff 55%, #b98cff);
  color: #fff;
  box-shadow: var(--h5-sh-accent);
  font-size: 15px; font-weight: 900;
  flex: 0 0 auto;
}
.h5-logo__text b { color: var(--h5-accent); }
@media (max-width: 480px) {
  .h5-logo__text { display: none; }
}

/* Search */
.h5-search {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  max-width: 560px;
  margin: 0 auto;
}
.h5-search form {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 0 6px 0 14px;
  background: var(--h5-bg);
  border: 1.5px solid transparent;
  border-radius: var(--h5-r-pill);
  transition: border-color 0.2s var(--h5-ease), background 0.2s var(--h5-ease), box-shadow 0.2s var(--h5-ease);
}
.h5-search form:focus-within {
  background: #fff;
  border-color: var(--h5-accent);
  box-shadow: 0 0 0 4px var(--h5-accent-ring);
}
.h5-search svg { flex: 0 0 auto; color: var(--h5-muted); }
.h5-search input {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  background: none;
  outline: none;
  font-size: 14.5px;
  font-weight: 500;
}
.h5-search input::placeholder { color: var(--h5-faint); }
.h5-search__go {
  flex: 0 0 auto;
  height: 32px;
  padding: 0 16px;
  border-radius: var(--h5-r-pill);
  background: var(--h5-accent);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  transition: background 0.18s var(--h5-ease), transform 0.18s var(--h5-ease);
}
.h5-search__go:hover { background: var(--h5-accent-600); transform: translateY(-1px); }

@media (max-width: 760px) {
  .h5-header__inner { gap: 8px; padding: 0 12px; }
  .h5-search { margin: 0; }
  .h5-search form { height: 40px; padding: 0 4px 0 12px; }
  .h5-search__go { display: none; }
  .h5-search form { padding: 0 14px; }
  .h5-hactions .h5-iconbtn { width: 36px; height: 36px; }
}
@media (max-width: 420px) {
  .h5-hactions { display: none; }
}

/* Live suggestions */
.h5-suggest {
  position: absolute;
  top: calc(100% + 10px);
  left: 0; right: 0;
  background: #fff;
  border: 1px solid var(--h5-line);
  border-radius: var(--h5-r-lg);
  box-shadow: var(--h5-sh-lg);
  padding: 8px;
  max-height: 60vh;
  overflow-y: auto;
  display: none;
  z-index: 70;
}
.h5-suggest.is-open { display: block; }
.h5-suggest a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-radius: var(--h5-r-sm);
  transition: background 0.15s var(--h5-ease);
}
.h5-suggest a:hover, .h5-suggest a.is-active { background: var(--h5-accent-soft); }
.h5-suggest img {
  width: 44px; height: 44px;
  border-radius: 9px;
  object-fit: cover;
  background: var(--h5-line-2);
  flex: 0 0 auto;
}
.h5-suggest .t { font-weight: 700; font-size: 14px; line-height: 1.3; }
.h5-suggest .c { font-size: 12px; color: var(--h5-muted); }
.h5-suggest__empty { padding: 18px; text-align: center; color: var(--h5-muted); font-size: 14px; }

/* Header actions */
.h5-hactions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }

.h5-iconbtn {
  display: grid;
  place-items: center;
  width: 40px; height: 40px;
  border-radius: 12px;
  color: var(--h5-ink-2);
  background: transparent;
  transition: background 0.18s var(--h5-ease), color 0.18s var(--h5-ease);
}
.h5-iconbtn:hover { background: var(--h5-accent-soft); color: var(--h5-accent); }

.h5-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 18px;
  border-radius: var(--h5-r-pill);
  font-weight: 700;
  font-size: 14px;
  white-space: nowrap;
  transition: transform 0.18s var(--h5-ease), background 0.18s var(--h5-ease), box-shadow 0.18s var(--h5-ease);
}
.h5-btn--primary {
  background: var(--h5-accent);
  color: #fff;
  box-shadow: var(--h5-sh-accent);
}
.h5-btn--primary:hover { background: var(--h5-accent-600); transform: translateY(-2px); }
.h5-btn--ghost {
  background: var(--h5-surface);
  color: var(--h5-ink);
  border: 1.5px solid var(--h5-line);
}
.h5-btn--ghost:hover { border-color: var(--h5-accent); color: var(--h5-accent); }
.h5-btn--lg { height: 48px; padding: 0 26px; font-size: 15.5px; }

.h5-menubtn { display: grid; }
@media (min-width: 1100px) { .h5-menubtn { display: none; } }

/* ==========================================================================
   Category rail (desktop sidebar)
   ========================================================================== */

.h5-rail {
  display: none;
}

@media (min-width: 1100px) {
  .h5-rail {
    display: block;
    position: sticky;
    top: calc(var(--h5-header-h) + 18px);
    max-height: calc(100vh - var(--h5-header-h) - 36px);
    overflow-y: auto;
    padding-right: 4px;
  }
}

.h5-rail__group + .h5-rail__group { margin-top: 22px; }

.h5-rail__label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--h5-faint);
  padding: 0 12px;
  margin-bottom: 8px;
}

.h5-rail__list { list-style: none; }

.h5-rail__link {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 12px;
  border-radius: 11px;
  font-size: 14px;
  font-weight: 600;
  color: var(--h5-ink-2);
  transition: background 0.16s var(--h5-ease), color 0.16s var(--h5-ease);
}
.h5-rail__link:hover { background: var(--h5-surface); color: var(--h5-accent); }
.h5-rail__link.is-active {
  background: var(--h5-accent-soft);
  color: var(--h5-accent);
  font-weight: 700;
}
.h5-rail__link svg { flex: 0 0 auto; }
.h5-rail__link > span:not(.h5-rail__count) {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.h5-rail__count {
  flex: 0 0 auto;
  margin-left: auto;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--h5-faint);
  background: var(--h5-line-2);
  padding: 1px 8px;
  border-radius: 99px;
}
.h5-rail__link:hover .h5-rail__count,
.h5-rail__link.is-active .h5-rail__count { background: #fff; color: var(--h5-accent); }

.h5-rail__thumb {
  width: 24px; height: 24px;
  border-radius: 7px;
  object-fit: cover;
  flex: 0 0 auto;
  background: var(--h5-line-2);
}

/* Mobile drawer */
.h5-drawer {
  position: fixed;
  inset: 0;
  z-index: 200;
  visibility: hidden;
  pointer-events: none;
}
.h5-drawer.is-open { visibility: visible; pointer-events: auto; }
.h5-drawer__scrim {
  position: absolute;
  inset: 0;
  background: rgba(15, 17, 32, 0.45);
  opacity: 0;
  transition: opacity 0.28s var(--h5-ease);
}
.h5-drawer.is-open .h5-drawer__scrim { opacity: 1; }
.h5-drawer__panel {
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: min(320px, 86vw);
  background: #fff;
  box-shadow: var(--h5-sh-lg);
  transform: translateX(-102%);
  transition: transform 0.3s var(--h5-ease);
  display: flex;
  flex-direction: column;
}
.h5-drawer.is-open .h5-drawer__panel { transform: none; }
.h5-drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--h5-line);
}
.h5-drawer__body { flex: 1 1 auto; overflow-y: auto; padding: 16px; }

/* ==========================================================================
   Chips
   ========================================================================== */

.h5-chips {
  display: flex;
  gap: 8px;
  padding: 4px 0 10px;
}
.h5-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
  height: 36px;
  padding: 0 16px;
  border-radius: var(--h5-r-pill);
  background: var(--h5-surface);
  border: 1.5px solid var(--h5-line);
  font-size: 13.5px;
  font-weight: 700;
  color: var(--h5-ink-2);
  white-space: nowrap;
  transition: all 0.18s var(--h5-ease);
}
.h5-chip:hover {
  border-color: var(--h5-accent);
  color: var(--h5-accent);
  transform: translateY(-2px);
  box-shadow: var(--h5-sh-sm);
}
.h5-chip.is-active {
  background: var(--h5-accent);
  border-color: var(--h5-accent);
  color: #fff;
  box-shadow: var(--h5-sh-accent);
}

/* ==========================================================================
   Section heading
   ========================================================================== */

.h5-sechead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin: 30px 0 14px;
}
.h5-sechead__title {
  font-size: clamp(18px, 2.2vw, 23px);
  font-weight: 850;
  letter-spacing: -0.03em;
}
.h5-sechead__title::before {
  content: "";
  display: inline-block;
  width: 4px; height: 18px;
  border-radius: 99px;
  background: linear-gradient(180deg, var(--h5-accent), #9b7bff);
  margin-right: 10px;
  vertical-align: -2px;
}
.h5-sechead__more {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--h5-accent);
  white-space: nowrap;
  transition: gap 0.18s var(--h5-ease);
}
.h5-sechead__more:hover { gap: 8px; }

/* ==========================================================================
   Game grid + cards
   ========================================================================== */

.h5-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  grid-auto-rows: 1fr;
  grid-auto-flow: dense;
  gap: 14px;
}

@media (min-width: 640px) {
  .h5-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 16px; }
}
@media (min-width: 1280px) {
  .h5-grid { grid-template-columns: repeat(auto-fill, minmax(172px, 1fr)); gap: 18px; }
}

.h5-grid--compact { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 12px; }

.h5-card {
  position: relative;
  border-radius: var(--h5-r-lg);
  background: var(--h5-surface);
  box-shadow: var(--h5-sh-xs);
  overflow: hidden;
  transition: transform 0.26s var(--h5-ease), box-shadow 0.26s var(--h5-ease);
  will-change: transform;
  contain: content;
}
.h5-card:hover { transform: translateY(-6px); box-shadow: var(--h5-sh); }
.h5-card:focus-within { transform: translateY(-6px); box-shadow: var(--h5-sh); }

.h5-card--md,
.h5-card--lg { grid-column: span 2; grid-row: span 2; }

.h5-card__link {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.h5-card__media {
  position: relative;
  display: block;
  flex: 1 1 auto;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: linear-gradient(135deg, #eceefb, #f6f7fc);
}
.h5-card--md .h5-card__media,
.h5-card--lg .h5-card__media { aspect-ratio: auto; }

.h5-card__media img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.5s var(--h5-ease);
}
.h5-card:hover .h5-card__media img { transform: scale(1.07); }

.h5-card__play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, rgba(15, 17, 32, 0) 40%, rgba(15, 17, 32, 0.5));
  opacity: 0;
  transition: opacity 0.26s var(--h5-ease);
}
.h5-card__play::after {
  content: "";
  position: absolute;
  width: 52px; height: 52px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--h5-sh);
  transform: scale(0.7);
  transition: transform 0.26s var(--h5-ease);
}
.h5-card__play svg {
  position: relative;
  z-index: 1;
  color: var(--h5-accent);
  margin-left: 3px;
  transform: scale(0.7);
  transition: transform 0.26s var(--h5-ease);
}
.h5-card:hover .h5-card__play { opacity: 1; }
.h5-card:hover .h5-card__play::after,
.h5-card:hover .h5-card__play svg { transform: scale(1); }

.h5-card__body {
  display: block;
  flex: 0 0 auto;
  padding: 9px 11px 11px;
}
.h5-card__title {
  display: -webkit-box;
  -webkit-line-clamp: 1;
  line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--h5-ink);
}
.h5-card__meta {
  display: block;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--h5-faint);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.h5-card--lg .h5-card__title,
.h5-card--md .h5-card__title { font-size: 15.5px; }
.h5-card--lg .h5-card__body,
.h5-card--md .h5-card__body { padding: 11px 14px 14px; }

.h5-card.is-featured::before {
  content: "HOT";
  position: absolute;
  top: 9px; left: 9px;
  z-index: 2;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.06em;
  color: #fff;
  background: linear-gradient(135deg, #ff5f6d, #ff8a3d);
  padding: 3px 8px;
  border-radius: 99px;
  box-shadow: 0 4px 10px rgba(255, 95, 109, 0.4);
}

/* Horizontal scroller variant */
.h5-rowscroll {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(148px, 1fr);
  gap: 14px;
  padding-bottom: 6px;
}
@media (min-width: 900px) {
  .h5-rowscroll { grid-auto-columns: minmax(168px, 1fr); }
}

/* ==========================================================================
   Hero
   ========================================================================== */

.h5-hero {
  position: relative;
  border-radius: var(--h5-r-xl);
  overflow: hidden;
  background:
    radial-gradient(1000px 400px at 12% -10%, rgba(255, 255, 255, 0.32), transparent 60%),
    radial-gradient(700px 340px at 88% 110%, rgba(255, 173, 233, 0.34), transparent 60%),
    linear-gradient(125deg, #5b4bff 0%, #7b5cff 42%, #a35bff 100%);
  color: #fff;
  padding: clamp(24px, 4.4vw, 46px);
  margin: 18px 0 8px;
  box-shadow: 0 18px 44px rgba(91, 75, 255, 0.28);
}
.h5-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(rgba(255, 255, 255, 0.15) 1px, transparent 1px);
  background-size: 22px 22px;
  opacity: 0.5;
  pointer-events: none;
}
.h5-hero__inner { position: relative; z-index: 1; max-width: 720px; }
.h5-hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.28);
  padding: 5px 13px;
  border-radius: 99px;
  margin-bottom: 14px;
}
.h5-hero h1 {
  font-size: clamp(25px, 4.6vw, 43px);
  font-weight: 900;
  letter-spacing: -0.04em;
  margin-bottom: 12px;
  text-wrap: balance;
}
.h5-hero p {
  font-size: clamp(14.5px, 1.6vw, 17px);
  color: rgba(255, 255, 255, 0.9);
  max-width: 60ch;
  margin-bottom: 22px;
}
.h5-hero__cta { display: flex; flex-wrap: wrap; gap: 12px; }
.h5-hero .h5-btn--primary { background: #fff; color: var(--h5-accent); box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18); }
.h5-hero .h5-btn--primary:hover { background: #f4f2ff; }
.h5-hero .h5-btn--ghost {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.4);
  color: #fff;
}
.h5-hero .h5-btn--ghost:hover { background: rgba(255, 255, 255, 0.22); border-color: #fff; color: #fff; }

.h5-hero__stats {
  display: flex;
  flex-wrap: wrap;
  gap: 26px;
  margin-top: 26px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
}
.h5-hero__stat b { display: block; font-size: 22px; font-weight: 900; letter-spacing: -0.03em; }
.h5-hero__stat span { font-size: 12.5px; color: rgba(255, 255, 255, 0.78); font-weight: 600; }

/* ==========================================================================
   Category cards
   ========================================================================== */

.h5-catgrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
  gap: 14px;
}

.h5-catcard {
  position: relative;
  display: block;
  border-radius: var(--h5-r-lg);
  overflow: hidden;
  aspect-ratio: 16 / 10;
  background: var(--h5-surface);
  box-shadow: var(--h5-sh-xs);
  transition: transform 0.26s var(--h5-ease), box-shadow 0.26s var(--h5-ease);
}
.h5-catcard:hover { transform: translateY(-5px); box-shadow: var(--h5-sh); }
.h5-catcard img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.5s var(--h5-ease);
}
.h5-catcard:hover img { transform: scale(1.08); }
.h5-catcard__veil {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(15, 17, 32, 0.05) 30%, rgba(15, 17, 32, 0.82));
}
.h5-catcard__text {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 12px 14px;
  color: #fff;
}
.h5-catcard__name {
  display: block;
  font-size: 15px; font-weight: 800; letter-spacing: -0.02em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.h5-catcard__count { display: block; font-size: 12px; color: rgba(255, 255, 255, 0.76); font-weight: 600; }

/* ==========================================================================
   Game detail page
   ========================================================================== */

.h5-play {
  background: var(--h5-surface);
  border-radius: var(--h5-r-xl);
  overflow: hidden;
  box-shadow: var(--h5-sh-sm);
  margin-top: 14px;
}

.h5-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #0f1120;
  overflow: hidden;
}
@media (max-width: 768px) {
  .h5-stage { aspect-ratio: 4 / 3; }
}
.h5-stage iframe {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  border: 0;
}

.h5-stage__cover {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-items: center;
  background-size: cover;
  background-position: center;
  cursor: pointer;
}
.h5-stage__cover::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(15, 17, 32, 0.62);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.h5-stage__coverin {
  position: relative;
  text-align: center;
  color: #fff;
  padding: 20px;
}
.h5-stage__coverin img {
  width: 96px; height: 96px;
  border-radius: 22px;
  object-fit: cover;
  margin: 0 auto 16px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.45);
}
.h5-stage__coverin h2 { font-size: 21px; margin-bottom: 4px; }
.h5-stage__coverin p { color: rgba(255, 255, 255, 0.7); font-size: 13.5px; margin-bottom: 18px; }
.h5-playbtn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 50px;
  padding: 0 30px;
  border-radius: 99px;
  background: var(--h5-accent);
  color: #fff;
  font-weight: 800;
  font-size: 16px;
  box-shadow: var(--h5-sh-accent);
  transition: transform 0.2s var(--h5-ease), background 0.2s var(--h5-ease);
}
.h5-playbtn:hover { transform: scale(1.05); background: var(--h5-accent-600); }

.h5-playbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-top: 1px solid var(--h5-line);
  flex-wrap: wrap;
}
.h5-playbar__id { display: flex; align-items: center; gap: 11px; min-width: 0; flex: 1 1 220px; }
.h5-playbar__id img { width: 46px; height: 46px; border-radius: 12px; object-fit: cover; flex: 0 0 auto; }
.h5-playbar__title { font-size: 16px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.2; }
.h5-playbar__sub { font-size: 12.5px; color: var(--h5-muted); font-weight: 600; }
.h5-playbar__sub a:hover { color: var(--h5-accent); }
.h5-playbar__acts { display: flex; align-items: center; gap: 6px; margin-left: auto; }

.h5-act {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  padding: 0 14px;
  border-radius: var(--h5-r-pill);
  background: var(--h5-bg);
  font-size: 13px;
  font-weight: 700;
  color: var(--h5-ink-2);
  transition: all 0.18s var(--h5-ease);
}
.h5-act:hover { background: var(--h5-accent-soft); color: var(--h5-accent); }
.h5-act.is-active { background: var(--h5-accent); color: #fff; }
.h5-act svg { flex: 0 0 auto; }

.h5-fs { background: var(--h5-accent); color: #fff; }
.h5-fs:hover { background: var(--h5-accent-600); color: #fff; }

@media (max-width: 640px) {
  .h5-stage__coverin { padding: 14px; }
  .h5-stage__coverin img { width: 64px; height: 64px; border-radius: 16px; margin-bottom: 10px; }
  .h5-stage__coverin h2 { font-size: 17px; }
  .h5-stage__coverin p { font-size: 12px; margin-bottom: 12px; }
  .h5-playbtn { height: 44px; padding: 0 24px; font-size: 15px; }

  .h5-playbar { gap: 10px; padding: 10px 12px; }
  .h5-playbar__id { flex: 1 1 100%; }
  .h5-playbar__acts { width: 100%; margin-left: 0; justify-content: space-between; }
  .h5-act { padding: 0 12px; }
  .h5-fs { flex: 1 1 auto; justify-content: center; }
  .h5-facts { grid-template-columns: repeat(auto-fit, minmax(112px, 1fr)); gap: 10px; }
  .h5-panel { padding: 18px 16px; }
  .h5-hero { padding: 22px 18px; border-radius: 22px; }
}

/* Fullscreen state */
.h5-play.is-full {
  position: fixed;
  inset: 0;
  z-index: 500;
  border-radius: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  background: #0f1120;
}
.h5-play.is-full .h5-stage { flex: 1 1 auto; aspect-ratio: auto; height: auto; }
.h5-play.is-full .h5-playbar { background: #171a2e; border-color: #262a45; }
.h5-play.is-full .h5-playbar__title { color: #fff; }
.h5-play.is-full .h5-act { background: #262a45; color: #c8cbe0; }

/* Game info panel */
.h5-panel {
  background: var(--h5-surface);
  border-radius: var(--h5-r-lg);
  padding: 22px;
  box-shadow: var(--h5-sh-xs);
}
.h5-panel + .h5-panel { margin-top: 16px; }
.h5-panel h2 { font-size: 19px; margin-bottom: 12px; }
.h5-panel h3 { font-size: 16px; margin: 18px 0 8px; }

.h5-prose { color: var(--h5-ink-2); font-size: 15px; line-height: 1.72; }
.h5-prose h2 { font-size: 21px; color: var(--h5-ink); margin: 26px 0 10px; }
.h5-prose h3 { font-size: 17px; color: var(--h5-ink); margin: 22px 0 8px; }
.h5-prose h4 { font-size: 15.5px; color: var(--h5-ink); margin: 18px 0 6px; }
.h5-prose > *:first-child { margin-top: 0; }
.h5-prose p { margin: 0 0 14px; }
.h5-prose ul, .h5-prose ol { margin: 0 0 16px; padding-left: 22px; }
.h5-prose li { margin-bottom: 7px; }
.h5-prose ul { list-style: disc; }
.h5-prose ol { list-style: decimal; }
.h5-prose a { color: var(--h5-accent); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.h5-prose a:hover { color: var(--h5-accent-700); }
.h5-prose strong { color: var(--h5-ink); font-weight: 700; }
.h5-prose blockquote {
  border-left: 3px solid var(--h5-accent);
  padding: 4px 0 4px 16px;
  margin: 0 0 16px;
  color: var(--h5-muted);
  font-style: italic;
}
.h5-prose table { width: 100%; border-collapse: collapse; margin-bottom: 16px; font-size: 14px; }
.h5-prose th, .h5-prose td { border: 1px solid var(--h5-line); padding: 9px 12px; text-align: left; }
.h5-prose th { background: var(--h5-bg); font-weight: 700; }
.h5-prose img { border-radius: var(--h5-r); margin: 8px 0 16px; }
.h5-prose hr { border: 0; border-top: 1px solid var(--h5-line); margin: 26px 0; }

.h5-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-top: 6px;
}
.h5-fact {
  background: var(--h5-bg);
  border-radius: var(--h5-r);
  padding: 12px 14px;
}
.h5-fact dt { font-size: 11px; font-weight: 800; letter-spacing: 0.07em; text-transform: uppercase; color: var(--h5-faint); }
.h5-fact dd { margin: 2px 0 0; font-size: 14.5px; font-weight: 700; color: var(--h5-ink); }
.h5-fact dd a:hover { color: var(--h5-accent); }

/* ==========================================================================
   Breadcrumbs
   ========================================================================== */

.h5-crumbs { margin: 16px 0 4px; }
.h5-crumbs ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  list-style: none;
  font-size: 13px;
  color: var(--h5-muted);
}
.h5-crumbs li { display: flex; align-items: center; gap: 6px; }
.h5-crumbs li + li::before {
  content: "";
  width: 5px; height: 5px;
  border-right: 1.6px solid var(--h5-faint);
  border-top: 1.6px solid var(--h5-faint);
  transform: rotate(45deg);
}
.h5-crumbs a { font-weight: 600; }
.h5-crumbs a:hover { color: var(--h5-accent); }
.h5-crumbs [aria-current] span { color: var(--h5-ink); font-weight: 700; }

/* ==========================================================================
   Page heading
   ========================================================================== */

.h5-pagehead { margin: 8px 0 6px; }
.h5-pagehead h1 {
  font-size: clamp(23px, 3.6vw, 34px);
  font-weight: 900;
  letter-spacing: -0.035em;
  text-wrap: balance;
}
.h5-pagehead p {
  margin-top: 8px;
  color: var(--h5-muted);
  font-size: 15px;
  max-width: 76ch;
}

/* ==========================================================================
   Pager
   ========================================================================== */

.h5-pager {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 7px;
  margin: 30px 0 8px;
}
.h5-pager__num, .h5-pager__btn {
  display: inline-grid;
  place-items: center;
  min-width: 40px; height: 40px;
  padding: 0 14px;
  border-radius: 12px;
  background: var(--h5-surface);
  border: 1.5px solid var(--h5-line);
  font-size: 14px;
  font-weight: 700;
  color: var(--h5-ink-2);
  transition: all 0.18s var(--h5-ease);
}
.h5-pager__num:hover, .h5-pager__btn:hover { border-color: var(--h5-accent); color: var(--h5-accent); }
.h5-pager__num.is-active {
  background: var(--h5-accent);
  border-color: var(--h5-accent);
  color: #fff;
  box-shadow: var(--h5-sh-accent);
}

/* ==========================================================================
   Ads
   ========================================================================== */

.h5-ad {
  display: block;
  margin: 22px auto;
  text-align: center;
  max-width: 100%;
  overflow: hidden;
}
.h5-ad__label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--h5-faint);
  margin-bottom: 6px;
}
.h5-ad__body { display: flex; justify-content: center; min-height: 0; }
.h5-ad--rail { margin: 18px 0; }
.h5-ad--inline { margin: 26px auto; }

/* ==========================================================================
   Footer
   ========================================================================== */

.h5-footer {
  background: var(--h5-surface);
  border-top: 1px solid var(--h5-line);
  margin-top: 46px;
  padding: 44px 0 0;
}
.h5-footer__grid {
  max-width: var(--h5-max);
  margin: 0 auto;
  padding: 0 16px;
  display: grid;
  gap: 32px;
  grid-template-columns: 1fr;
}
@media (min-width: 720px) {
  .h5-footer__grid { grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 40px; }
}
.h5-footer__brand { max-width: 42ch; }
.h5-footer__brand p { color: var(--h5-muted); font-size: 14px; margin-top: 12px; }
.h5-footer h3 {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--h5-faint);
  margin-bottom: 12px;
}
.h5-footer ul { list-style: none; }
.h5-footer li { margin-bottom: 8px; }
.h5-footer li a { font-size: 14px; color: var(--h5-ink-2); font-weight: 500; }
.h5-footer li a:hover { color: var(--h5-accent); }

.h5-footer__about {
  max-width: var(--h5-max);
  margin: 34px auto 0;
  padding: 26px 16px 0;
  border-top: 1px solid var(--h5-line);
}
.h5-footer__about .h5-prose { font-size: 14px; color: var(--h5-muted); }
.h5-footer__about .h5-prose h2,
.h5-footer__about .h5-prose h3 { font-size: 15.5px; color: var(--h5-ink); margin: 18px 0 7px; }

.h5-footer__bar {
  border-top: 1px solid var(--h5-line);
  margin-top: 26px;
}
.h5-footer__barin {
  max-width: var(--h5-max);
  margin: 0 auto;
  padding: 18px 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--h5-muted);
}
.h5-footer__social { display: flex; gap: 8px; }
.h5-footer__social a {
  display: grid;
  place-items: center;
  width: 34px; height: 34px;
  border-radius: 10px;
  background: var(--h5-bg);
  color: var(--h5-muted);
  transition: all 0.18s var(--h5-ease);
}
.h5-footer__social a:hover { background: var(--h5-accent); color: #fff; }

/* ==========================================================================
   Misc blocks
   ========================================================================== */

.h5-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 46px 20px;
  color: var(--h5-muted);
  background: var(--h5-surface);
  border-radius: var(--h5-r-lg);
}
.h5-empty a { color: var(--h5-accent); font-weight: 700; }

.h5-404 {
  text-align: center;
  padding: 60px 20px 30px;
}
.h5-404__code {
  font-size: clamp(76px, 16vw, 150px);
  font-weight: 900;
  letter-spacing: -0.06em;
  line-height: 1;
  background: linear-gradient(135deg, var(--h5-accent), #b98cff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.h5-404 h1 { font-size: clamp(21px, 3vw, 28px); margin: 8px 0 10px; }
.h5-404 p { color: var(--h5-muted); max-width: 52ch; margin: 0 auto 24px; }

/* Toast */
.h5-toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translate(-50%, 140%);
  z-index: 400;
  background: var(--h5-ink);
  color: #fff;
  padding: 12px 22px;
  border-radius: 99px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--h5-sh-lg);
  transition: transform 0.34s var(--h5-ease);
}
.h5-toast.is-open { transform: translate(-50%, 0); }

/* Modal */
.h5-modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  place-items: center;
  padding: 20px;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.24s var(--h5-ease), visibility 0.24s var(--h5-ease);
}
.h5-modal.is-open { visibility: visible; opacity: 1; }
.h5-modal__scrim { position: absolute; inset: 0; background: rgba(15, 17, 32, 0.5); }
.h5-modal__panel {
  position: relative;
  width: min(460px, 100%);
  background: #fff;
  border-radius: var(--h5-r-lg);
  box-shadow: var(--h5-sh-lg);
  padding: 22px;
  transform: translateY(14px) scale(0.98);
  transition: transform 0.28s var(--h5-ease);
}
.h5-modal.is-open .h5-modal__panel { transform: none; }
.h5-modal h3 { font-size: 18px; margin-bottom: 4px; }
.h5-modal p { color: var(--h5-muted); font-size: 14px; }
.h5-modal textarea {
  width: 100%;
  min-height: 110px;
  resize: vertical;
  border: 1.5px solid var(--h5-line);
  border-radius: var(--h5-r);
  padding: 12px 14px;
  font-size: 14px;
  outline: none;
  margin: 12px 0 14px;
  transition: border-color 0.18s var(--h5-ease), box-shadow 0.18s var(--h5-ease);
}
.h5-modal textarea:focus { border-color: var(--h5-accent); box-shadow: 0 0 0 4px var(--h5-accent-ring); }
.h5-modal__acts { display: flex; justify-content: flex-end; gap: 10px; }

/* Forms */
.h5-field { margin-bottom: 16px; }
.h5-field label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--h5-ink-2);
  margin-bottom: 6px;
}
.h5-input, .h5-textarea, .h5-select {
  width: 100%;
  border: 1.5px solid var(--h5-line);
  border-radius: var(--h5-r);
  background: #fff;
  padding: 11px 14px;
  font-size: 14.5px;
  outline: none;
  transition: border-color 0.18s var(--h5-ease), box-shadow 0.18s var(--h5-ease);
}
.h5-textarea { min-height: 130px; resize: vertical; }
.h5-input:focus, .h5-textarea:focus, .h5-select:focus {
  border-color: var(--h5-accent);
  box-shadow: 0 0 0 4px var(--h5-accent-ring);
}

.h5-note {
  border-radius: var(--h5-r);
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 16px;
}
.h5-note--ok { background: #e9f9f1; color: #076f45; }
.h5-note--err { background: #fdeceb; color: #a12a20; }

/* FAQ accordion */
.h5-faq { border-top: 1px solid var(--h5-line); }
.h5-faq details {
  border-bottom: 1px solid var(--h5-line);
  padding: 4px 0;
}
.h5-faq summary {
  list-style: none;
  cursor: pointer;
  padding: 16px 34px 16px 0;
  font-size: 15.5px;
  font-weight: 700;
  position: relative;
  color: var(--h5-ink);
}
.h5-faq summary::-webkit-details-marker { display: none; }
.h5-faq summary::after {
  content: "";
  position: absolute;
  right: 6px; top: 24px;
  width: 8px; height: 8px;
  border-right: 2px solid var(--h5-muted);
  border-bottom: 2px solid var(--h5-muted);
  transform: rotate(45deg);
  transition: transform 0.22s var(--h5-ease);
}
.h5-faq details[open] summary { color: var(--h5-accent); }
.h5-faq details[open] summary::after { transform: rotate(-135deg); border-color: var(--h5-accent); }
.h5-faq__a { padding: 0 0 18px; color: var(--h5-ink-2); font-size: 14.5px; line-height: 1.7; }

/* Tag cloud */
.h5-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.h5-tag {
  font-size: 13px;
  font-weight: 600;
  padding: 6px 13px;
  border-radius: 99px;
  background: var(--h5-bg);
  color: var(--h5-ink-2);
  transition: all 0.16s var(--h5-ease);
}
.h5-tag:hover { background: var(--h5-accent); color: #fff; }

/* Mobile bottom nav */
.h5-tabbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 90;
  display: flex;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--h5-line);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
}
@media (min-width: 1100px) { .h5-tabbar { display: none; } }
body { padding-bottom: 64px; }
@media (min-width: 1100px) { body { padding-bottom: 0; } }

.h5-tab {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 2px;
  border-radius: 12px;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--h5-muted);
  transition: color 0.16s var(--h5-ease);
}
.h5-tab.is-active { color: var(--h5-accent); }

/* Back to top */
.h5-top {
  position: fixed;
  right: 18px;
  bottom: 78px;
  z-index: 80;
  width: 44px; height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--h5-surface);
  color: var(--h5-accent);
  box-shadow: var(--h5-sh);
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: all 0.26s var(--h5-ease);
}
.h5-top.is-on { opacity: 1; pointer-events: auto; transform: none; }
@media (min-width: 1100px) { .h5-top { bottom: 24px; } }

/* Thumbnail fallback when a remote game image fails to load */
img.is-fallback {
  object-fit: contain !important;
  background: #eef0f8;
  opacity: 0.55;
}

/* Skeleton shimmer */
.h5-skel {
  border-radius: var(--h5-r-lg);
  background: linear-gradient(90deg, #eef0f8 25%, #f7f8fc 37%, #eef0f8 63%);
  background-size: 400% 100%;
  animation: h5shimmer 1.3s ease infinite;
  aspect-ratio: 1;
}
@keyframes h5shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* Reveal on scroll */
.h5-reveal { opacity: 0; transform: translateY(14px); }
.h5-reveal.is-in {
  opacity: 1;
  transform: none;
  transition: opacity 0.5s var(--h5-ease), transform 0.5s var(--h5-ease);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .h5-reveal { opacity: 1; transform: none; }
}

/* Print */
@media print {
  .h5-header, .h5-rail, .h5-tabbar, .h5-ad, .h5-top, .h5-footer__social { display: none !important; }
  body { background: #fff; }
}
