* {
  box-sizing: border-box;
}

:root {
  --bg: #10131c;
  --bg-soft: #171b26;
  --panel: #171c29;
  --panel-2: #1f2635;
  --line: #2a3346;
  --text: #f5f7ff;
  --muted: #9aabc8;
  --brand: #00b5ff;
  --brand-2: #2c7bff;
  --brand-3: #7f54ff;
  --shadow: 0 18px 40px rgba(2, 6, 16, 0.45);
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top right, rgba(0, 181, 255, 0.14), transparent 25%),
    radial-gradient(circle at top left, rgba(127, 84, 255, 0.12), transparent 20%),
    var(--bg);
  color: var(--text);
  font-family: "Inter", sans-serif;
}

body {
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

img {
  max-width: 100%;
}

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

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.site-shell {
  display: grid;
  grid-template-columns: 250px 1fr;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  max-height: 100vh;
  padding: 18px 14px 16px 16px;
  border-right: 1px solid rgba(42, 51, 70, 0.9);
  background:
    linear-gradient(165deg, rgba(124, 92, 255, 0.06) 0%, transparent 42%),
    linear-gradient(180deg, #0a0e16 0%, #0f141f 45%, #0c101a 100%);
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow: hidden;
  min-height: 0;
  isolation: isolate;
}

.sidebar::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(
    180deg,
    rgba(124, 92, 255, 0.55) 0%,
    rgba(99, 102, 241, 0.25) 45%,
    rgba(45, 212, 191, 0.2) 100%
  );
  opacity: 0.85;
  pointer-events: none;
  z-index: 0;
}

.sidebar > * {
  position: relative;
  z-index: 1;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 0;
  flex-shrink: 0;
  padding: 10px 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(124, 92, 255, 0.14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.brand-link {
  display: block;
  text-decoration: none;
  color: inherit;
  border-radius: 14px;
  outline-offset: 3px;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.brand-link:hover {
  opacity: 0.92;
}

.brand-link:active {
  transform: scale(0.99);
}

.brand-link:focus-visible {
  outline: 2px solid var(--brand);
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--brand), var(--brand-3));
  font-weight: 800;
  font-size: 1.3rem;
  color: white;
  box-shadow: 0 10px 24px rgba(0, 181, 255, 0.3);
  animation: pulseGlow 3s ease-in-out infinite;
}

.brand-mark-banner {
  width: 100%;
  height: auto;
  aspect-ratio: 1656 / 600;
  border-radius: 14px;
  overflow: hidden;
  border: 0;
  background: transparent;
  box-shadow: none;
  animation: none;
  padding: 0;
}

.brand h1,
.brand p {
  margin: 0;
}

.brand h1 {
  font-size: 1.25rem;
}

.brand p {
  color: var(--muted);
  font-size: 0.92rem;
  margin-top: 4px;
}

/* ——— Sidebar navigation ——— */
.sidebar-nav.side-nav {
  display: flex;
  flex-direction: column;
  gap: 0;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  padding-right: 2px;
  margin-bottom: 0;
}

.sidebar-block--browse {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: hidden;
}

.sidebar-block--browse > .sidebar-heading {
  flex-shrink: 0;
}

.sidebar-heading {
  margin: 0;
  padding: 0 4px 0 2px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: #6b7a95;
  line-height: 1.35;
}

.sidebar-stack {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.sidebar-block--browse > .sidebar-stack {
  flex: 1 1 0;
  min-height: 72px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: rgba(124, 92, 255, 0.35) transparent;
}

#sidebarCategoryLinks.side-nav-categories {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 0;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 9px 10px 9px 11px;
  border-radius: 11px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.02);
  color: #8b95ab;
  font-size: 0.88rem;
  font-weight: 500;
  text-decoration: none;
  text-align: left;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
  position: relative;
  box-sizing: border-box;
}

.sidebar-link::after {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 3px;
  height: 0;
  border-radius: 0 3px 3px 0;
  transform: translateY(-50%);
  opacity: 0;
  transition: height 0.2s ease, opacity 0.2s ease;
}

.sidebar-link:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #c8d0e5;
}

.sidebar-link.active::after {
  height: 62%;
  opacity: 1;
}

.sidebar-link__icon {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: inherit;
}

.sidebar-link__icon svg {
  width: 17px;
  height: 17px;
  display: block;
  color: currentColor;
}

.sidebar-link__text {
  flex: 1;
  min-width: 0;
  line-height: 1.25;
}

/* Home — purple */
.sidebar-nav .nav-sidebar-home:hover {
  color: #c4b5fd;
  border-color: rgba(124, 92, 255, 0.12);
  background: rgba(124, 92, 255, 0.06);
}

.sidebar-nav .nav-sidebar-home:hover .sidebar-link__icon {
  border-color: rgba(124, 92, 255, 0.25);
  background: rgba(124, 92, 255, 0.1);
}

.sidebar-nav .nav-sidebar-home.active {
  background: rgba(124, 92, 255, 0.2);
  border-color: rgba(167, 139, 250, 0.45);
  color: #ede9fe;
  font-weight: 600;
  box-shadow: 0 0 0 1px rgba(124, 92, 255, 0.12);
}

.sidebar-nav .nav-sidebar-home.active .sidebar-link__icon {
  background: rgba(124, 92, 255, 0.25);
  border-color: rgba(196, 181, 253, 0.35);
}

.sidebar-nav .nav-sidebar-home.active::after {
  background: #c4b5fd;
}

/* Popular — amber */
.sidebar-nav .nav-link--popular:hover {
  color: #fcd34d;
  border-color: rgba(251, 191, 36, 0.15);
  background: rgba(251, 191, 36, 0.07);
}

.sidebar-nav .nav-link--popular:hover .sidebar-link__icon {
  border-color: rgba(252, 211, 77, 0.3);
  background: rgba(251, 191, 36, 0.12);
}

.sidebar-nav .nav-link--popular.active {
  background: rgba(251, 191, 36, 0.2);
  border-color: rgba(252, 211, 77, 0.48);
  color: #fffbeb;
  font-weight: 600;
  box-shadow: 0 0 0 1px rgba(251, 191, 36, 0.1);
}

.sidebar-nav .nav-link--popular.active .sidebar-link__icon {
  background: rgba(251, 191, 36, 0.22);
  border-color: rgba(253, 230, 138, 0.4);
}

.sidebar-nav .nav-link--popular.active::after {
  background: #fcd34d;
}

/* Recently played — teal */
.sidebar-nav .nav-link--recent:hover {
  color: #6ee7b7;
  border-color: rgba(45, 212, 191, 0.15);
  background: rgba(45, 212, 191, 0.07);
}

.sidebar-nav .nav-link--recent:hover .sidebar-link__icon {
  border-color: rgba(52, 211, 153, 0.28);
  background: rgba(45, 212, 191, 0.1);
}

.sidebar-nav .nav-link--recent.active {
  background: rgba(45, 212, 191, 0.16);
  border-color: rgba(52, 211, 153, 0.42);
  color: #ccfbf1;
  font-weight: 600;
  box-shadow: 0 0 0 1px rgba(45, 212, 191, 0.1);
}

.sidebar-nav .nav-link--recent.active .sidebar-link__icon {
  background: rgba(45, 212, 191, 0.18);
  border-color: rgba(110, 231, 183, 0.35);
}

.sidebar-nav .nav-link--recent.active::after {
  background: #5eead4;
}

/* Category rows — purple */
.sidebar-nav .nav-sidebar-cat:hover {
  color: #c4b5fd;
  border-color: rgba(124, 92, 255, 0.12);
  background: rgba(124, 92, 255, 0.06);
}

.sidebar-nav .nav-sidebar-cat:hover .sidebar-link__icon {
  border-color: rgba(124, 92, 255, 0.22);
  background: rgba(124, 92, 255, 0.08);
}

.sidebar-nav .nav-sidebar-cat.active {
  background: rgba(124, 92, 255, 0.2);
  border-color: rgba(167, 139, 250, 0.45);
  color: #ede9fe;
  font-weight: 600;
  box-shadow: 0 0 0 1px rgba(124, 92, 255, 0.12);
}

.sidebar-nav .nav-sidebar-cat.active .sidebar-link__icon {
  background: rgba(124, 92, 255, 0.22);
  border-color: rgba(196, 181, 253, 0.32);
}

.sidebar-nav .nav-sidebar-cat.active::after {
  background: #c4b5fd;
}

.sidebar-footer {
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 24px;
  padding: 18px;
  border-radius: 18px;
  background: var(--panel-2);
  color: var(--muted);
  border: 1px solid var(--line);
  line-height: 1.6;
  font-size: 0.92rem;
  animation: fadeUp 0.8s ease;
}

.sidebar-footer p {
  margin: 0;
}

.sidebar-links-footer {
  margin-top: auto;
  flex-shrink: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 12px 4px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-links-footer a {
  color: #7d8ca8;
  text-decoration: none;
  font-size: 0.78rem;
  line-height: 1.2;
  padding: 6px 9px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(0, 0, 0, 0.25);
  transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.sidebar-links-footer a:hover {
  color: #c4b5fd;
  background: rgba(124, 92, 255, 0.1);
  border-color: rgba(124, 92, 255, 0.32);
}

.main-content {
  padding: 20px 24px 30px;
}

.topbar {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.search-wrap {
  flex: 1;
}

.search-wrap input {
  width: 100%;
  padding: 13px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #141a26;
  color: var(--text);
  outline: none;
  transition: .25s ease;
}

.search-wrap input:focus {
  border-color: rgba(0, 181, 255, 0.5);
  box-shadow: 0 0 0 4px rgba(0, 181, 255, 0.14);
  transform: translateY(-1px);
}

.search-wrap input::placeholder {
  color: #95a0c2;
}

.games-section {
  padding: 18px;
  border-radius: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.home-section {
  margin-bottom: 22px;
}

.games-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 18px;
}

.games-toolbar h3 {
  margin: 0;
  font-size: 1.05rem;
}

.games-toolbar span {
  color: var(--muted);
}

.games-toolbar--single {
  justify-content: flex-start;
}

.toolbar-title-with-icon {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.category-toolbar {
  align-items: center;
}

.category-toolbar-search {
  flex: 1 1 14rem;
  max-width: 22rem;
  min-width: 0;
}

.search-wrap--category input:focus {
  border-color: rgba(124, 92, 255, 0.55);
  box-shadow: 0 0 0 4px rgba(124, 92, 255, 0.16);
}

.category-toolbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.category-toolbar-left h3 {
  margin: 0 0 4px;
}

.category-toolbar-left span {
  color: var(--muted);
}

.category-toolbar-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  flex-shrink: 0;
  background: #141a27;
  display: grid;
  place-items: center;
}

.category-toolbar-icon.small {
  width: 38px;
  height: 38px;
  border-radius: 12px;
}

.category-toolbar-icon svg {
  width: 22px;
  height: 22px;
  color: #dfe5ff;
}

.category-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.category-arrow-btn {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #161c2a;
  color: var(--text);
  transition: .2s ease;
}

.category-arrow-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  border-color: rgba(0, 181, 255, 0.45);
  background: rgba(0, 181, 255, 0.14);
}

.category-arrow-btn:disabled {
  opacity: .38;
  cursor: not-allowed;
}

.category-more-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--text);
  border: 1px solid var(--line);
  background: #161c2a;
  padding: 10px 14px;
  border-radius: 14px;
  transition: 0.25s ease;
}

.category-more-link:hover {
  transform: translateY(-2px);
  border-color: rgba(0, 181, 255, 0.45);
  background: rgba(0, 181, 255, 0.14);
}

.category-more-link .arrow {
  font-size: 1rem;
  line-height: 1;
  transition: transform .25s ease;
}

.category-more-link:hover .arrow {
  transform: translateX(4px);
}

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

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

.category-page-section .games-toolbar {
  margin-bottom: 12px;
}

.category-page-grid {
  grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
  gap: 16px;
}

/* category.html: 25 games per page — dense, even rows (5×5 on large screens) */
@media (min-width: 1100px) {
  .category-page-section .category-page-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 14px 16px;
  }
}

@media (min-width: 840px) and (max-width: 1099px) {
  .category-page-section .category-page-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
  }
}

@media (min-width: 721px) and (max-width: 839px) {
  .category-page-section .category-page-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px 14px;
  }
}

.game-card {
  background: #141a27;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: 0 10px 22px rgba(2, 6, 16, 0.35);
  transition: transform 0.18s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.game-card:hover {
  transform: translateY(-4px);
  border-color: rgba(0, 181, 255, 0.45);
  box-shadow: 0 22px 40px rgba(0, 0, 0, 0.45);
}

.game-link {
  color: inherit;
  text-decoration: none;
}

.game-thumb-btn {
  border: 0;
  background: transparent;
  padding: 0;
  width: 100%;
  position: relative;
  display: block;
}

.game-thumb-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #0f162d;
  overflow: hidden;
  border-radius: 0;
}

.game-thumb,
.game-thumb-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.game-thumb {
  z-index: 0;
  object-fit: contain;
}

.game-thumb-video {
  z-index: 1;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
  background: #0f162d;
}

.game-card.has-preview-video:hover .game-thumb-video {
  opacity: 1;
}

.game-card.has-preview-video:hover .game-thumb {
  opacity: 0;
}

.game-thumb {
  transition: opacity 0.2s ease, transform 0.3s ease;
}

.game-card:hover .game-thumb-wrap .game-thumb {
  transform: scale(1.03);
}

.game-card.has-preview-video:hover .game-thumb-wrap .game-thumb {
  transform: none;
}

.play-badge {
  position: absolute;
  right: 8px;
  bottom: 8px;
  background: rgba(8, 12, 19, 0.78);
  color: white;
  padding: 6px 9px;
  border-radius: 999px;
  font-size: 0.75rem;
  transition: .25s ease;
}

.game-card:hover .play-badge {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
}

.game-info {
  padding: 10px;
}

.game-name {
  font-size: 0.88rem;
  margin: 0 0 5px;
  line-height: 1.3;
}

.game-meta {
  font-size: 0.78rem;
  margin: 0;
  color: var(--muted);
}

.empty-state {
  text-align: center;
  padding: 60px 20px 30px;
  color: var(--muted);
}

.empty-state h4 {
  margin: 0 0 10px;
  color: var(--text);
}

.empty-state p {
  margin: 0;
}

.empty-inline-note {
  color: var(--muted);
  padding: 10px 0;
}

.reveal {
  opacity: 1;
  transform: none;
  transition: none;
}

.reveal.show {
  opacity: 1;
  transform: none;
}

.game-page-wrap {
  display: grid;
  gap: 22px;
}

.game-page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.game-page-header h1 {
  margin: 12px 0 8px;
  font-size: 2rem;
}

.game-page-header p {
  margin: 0;
  color: var(--muted);
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #dfe5ff;
  text-decoration: none;
  border: 1px solid var(--line);
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(255,255,255,.04);
  transition: .2s ease;
}

.back-link:hover {
  transform: translateY(-2px);
  border-color: rgba(109,124,255,.45);
}

.game-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 22px;
}

.game-main-column,
.game-side-column {
  display: grid;
  gap: 22px;
}

.game-page-frame {
  min-height: 72vh;
}

.game-player-shell {
  width: 100%;
}

.game-frame-wrap {
  width: 100%;
  min-height: 72vh;
  height: 72vh;
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #090d19;
  display: block;
}

.game-frame-wrap iframe {
  width: 100%;
  height: 100%;
  min-height: 72vh;
  border: 0;
  display: block;
}

.game-frame-wrap:fullscreen,
.game-frame-wrap:-webkit-full-screen {
  width: 100vw;
  height: 100vh;
  border-radius: 0;
  border: 0;
  background: #000;
}

.game-frame-wrap:fullscreen iframe,
.game-frame-wrap:-webkit-full-screen iframe {
  width: 100vw;
  height: 100vh;
  min-height: 100vh;
}

.game-controls-bar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.game-control-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.04);
  color: var(--text);
  padding: 12px 14px;
  transition: .2s ease;
}

.game-control-btn:hover:not(.disabled) {
  transform: translateY(-2px);
  border-color: rgba(109,124,255,.45);
  background: rgba(109,124,255,.12);
}

.game-control-btn.active {
  border-color: rgba(109,124,255,.45);
  background: rgba(109,124,255,.18);
}

.game-control-btn.disabled {
  opacity: .55;
  cursor: not-allowed;
}

.game-control-icon {
  font-size: 1rem;
  line-height: 1;
}

.game-control-btn--icononly {
  gap: 8px;
  padding: 12px 14px;
}

.game-control-btn--icononly .game-control-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.game-toolbar-svg {
  width: 22px;
  height: 22px;
  display: block;
}

.reaction-count {
  display: inline-flex;
  min-width: 20px;
  justify-content: center;
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 600;
}

.game-description-text {
  color: var(--muted);
  line-height: 1.7;
  margin: 0 0 20px;
}

.game-tags-section {
  margin-top: 12px;
}

.game-subheading {
  margin: 0 0 12px;
  font-size: 1rem;
  color: var(--text);
}

.tag-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tag-pill {
  border: 1px solid rgba(0, 181, 255, 0.28);
  background: rgba(0, 181, 255, 0.14);
  color: #eef1ff;
  border-radius: 999px;
  padding: 9px 14px;
  transition: .2s ease;
}

.tag-pill:hover,
.tag-pill.active {
  transform: translateY(-2px);
  border-color: rgba(0, 181, 255, 0.55);
  background: rgba(0, 181, 255, 0.26);
}

.tag-empty-inline {
  color: var(--muted);
}

.tag-empty-note {
  color: var(--muted);
  margin-bottom: 16px;
}

.brand-mark-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 0;
  display: block;
}

.brand-mark-banner .brand-mark-image {
  width: 100%;
  height: auto;
  max-height: none;
  object-fit: contain;
}

.tag-results-grid {
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 16px;
}

.compact-side-panel {
  position: sticky;
  top: 24px;
}

/* Game page sidebar: full-width game cards with large thumbnails */
.related-category-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

.related-category-grid .game-card {
  box-shadow: 0 8px 20px rgba(2, 6, 16, 0.4);
}

.related-category-grid .game-name {
  font-size: 0.95rem;
  line-height: 1.35;
}

.related-category-grid .game-meta {
  font-size: 0.8rem;
}

.info-page {
  max-width: 900px;
  margin: 0 auto;
}

.info-hero {
  margin-bottom: 22px;
}

.info-hero h1 {
  margin: 0 0 12px;
  font-size: 2rem;
}

.info-hero p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}

.info-card {
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  border-radius: 24px;
  background: rgba(17, 24, 39, 0.65);
  padding: 22px;
}

.info-card h3 {
  margin: 0 0 12px;
}

.info-card p,
.info-card li {
  color: var(--muted);
  line-height: 1.7;
}

.info-card ul {
  margin: 0;
  padding-left: 18px;
}

@keyframes floatOrb {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(30px, 20px) scale(1.08); }
}

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 12px 30px rgba(109,124,255,.35); }
  50% { box-shadow: 0 16px 40px rgba(138,87,255,.45); }
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-18px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@media (max-width: 1320px) {
  .compact-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 1180px) {
  .compact-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

  .compact-side-panel {
    position: static;
  }

  .related-category-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
  }

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

@media (max-width: 1024px) {
  .site-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .sidebar-nav.side-nav {
    max-height: none;
    overflow: visible;
  }

  .sidebar-block--browse {
    flex: none;
    overflow: visible;
    max-height: none;
  }

  .sidebar-block--browse > .sidebar-stack {
    overflow: visible;
    max-height: none;
    flex: none;
  }

  .sidebar-footer,
  .sidebar-links-footer {
    position: static;
    margin-top: 22px;
  }

  .hero-banner {
    grid-template-columns: 1fr;
    padding: 18px;
  }

  .hero-aside {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .hero-aside-card {
    flex: 1 1 200px;
  }
}

@media (max-width: 600px) {
  .hero-category-scroll {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
  }

  .hero-cat-chip {
    flex-shrink: 0;
  }
}

@media (max-width: 720px) {
  .main-content,
  .sidebar {
    padding: 18px;
  }

  .topbar,
  .games-toolbar,
  .category-toolbar {
    display: grid;
    grid-template-columns: 1fr;
  }

  .topbar-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .games-grid,
  .compact-grid,
  .category-page-grid,
  .tag-results-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .category-toolbar-left {
    align-items: flex-start;
  }

  .category-toolbar-search {
    max-width: none;
    width: 100%;
  }

  .category-toolbar-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .game-page-header h1 {
    font-size: 1.5rem;
  }

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

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

  .game-frame-wrap {
    min-height: 58vh;
    height: 58vh;
  }

  .game-frame-wrap iframe {
    min-height: 58vh;
  }
}

.legal-page {
  max-width: 900px;
  margin: 60px auto;
  padding: 30px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
}

.legal-page h1 {
  margin-top: 0;
  font-size: 2rem;
}

.legal-page h2 {
  margin-top: 28px;
  color: #cfd6ff;
}

.legal-page p,
.legal-page li {
  color: #aab3cf;
  line-height: 1.6;
}

.back-btn {
  display: inline-block;
  margin-top: 30px;
  padding: 12px 16px;
  border-radius: 12px;
  text-decoration: none;
  color: white;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
}

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

.topbar-btn {
  text-decoration: none;
  color: #08101d;
  background: linear-gradient(135deg, var(--brand), #78d6ff);
  border-radius: 10px;
  padding: 10px 12px;
  font-weight: 700;
  border: 1px solid transparent;
}

.topbar-btn.ghost {
  color: var(--text);
  background: #171d2b;
  border-color: var(--line);
}


.hero-banner {
  display: block;
  margin-bottom: 22px;
  border: 1px solid rgba(124, 92, 255, 0.22);
  border-radius: 16px;
  padding: 18px 18px 16px;
  background: linear-gradient(165deg, rgba(15, 20, 32, 0.98) 0%, rgba(10, 14, 22, 0.99) 100%);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.hero-banner--browse {
  border-color: rgba(255, 255, 255, 0.06);
  background:
    linear-gradient(135deg, rgba(124, 92, 255, 0.07) 0%, transparent 42%),
    linear-gradient(180deg, #0f141f 0%, #0a0e16 100%);
}

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

.hero-browse-heading {
  margin-bottom: 6px;
}

.hero-browse-lead {
  margin: 0 0 14px;
  padding: 0 2px;
  color: #8b95ab;
  line-height: 1.5;
  font-size: 0.86rem;
  max-width: 48ch;
}

.hero-browse-panel {
  padding: 10px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.hero-category-scroll {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: stretch;
  max-height: none;
  padding: 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(124, 92, 255, 0.35) transparent;
}

/* Home hero chips — align with sidebar-link rows (inset panel) */
.hero-cat-chip {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  padding: 9px 11px 9px 9px;
  border-radius: 11px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.02);
  color: #8b95ab;
  font-weight: 500;
  font-size: 0.88rem;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.hero-cat-chip:not(.hero-cat-chip--all):not(.hero-cat-chip--spotlight):not(.hero-cat-chip--recent) {
  border-color: rgba(255, 255, 255, 0.04);
}

.hero-cat-chip:not(.hero-cat-chip--all):not(.hero-cat-chip--spotlight):not(.hero-cat-chip--recent):hover {
  border-color: rgba(124, 92, 255, 0.22);
  background: rgba(124, 92, 255, 0.08);
  color: #c4b5fd;
}

/* Home — purple */
.hero-cat-chip--all:hover {
  border-color: rgba(124, 92, 255, 0.25);
  background: rgba(124, 92, 255, 0.08);
  color: #c4b5fd;
}

.hero-cat-chip--all.active {
  background: rgba(124, 92, 255, 0.2);
  border-color: rgba(167, 139, 250, 0.45);
  color: #ede9fe;
  font-weight: 600;
  box-shadow: 0 0 0 1px rgba(124, 92, 255, 0.1);
}

/* Popular — amber */
.hero-cat-chip--spotlight:hover {
  border-color: rgba(252, 211, 77, 0.35);
  background: rgba(251, 191, 36, 0.1);
  color: #fcd34d;
}

.hero-cat-chip--spotlight.active {
  background: rgba(251, 191, 36, 0.2);
  border-color: rgba(252, 211, 77, 0.48);
  color: #fffbeb;
  font-weight: 600;
  box-shadow: 0 0 0 1px rgba(251, 191, 36, 0.1);
}

/* Recent — teal */
.hero-cat-chip--recent:hover {
  border-color: rgba(52, 211, 153, 0.3);
  background: rgba(45, 212, 191, 0.08);
  color: #6ee7b7;
}

.hero-cat-chip--recent.active {
  background: rgba(45, 212, 191, 0.16);
  border-color: rgba(52, 211, 153, 0.42);
  color: #ccfbf1;
  font-weight: 600;
  box-shadow: 0 0 0 1px rgba(45, 212, 191, 0.1);
}

.hero-cat-icon {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: currentColor;
}

.hero-cat-chip:not(.hero-cat-chip--all):not(.hero-cat-chip--spotlight):not(.hero-cat-chip--recent) .hero-cat-icon {
  background: rgba(124, 92, 255, 0.1);
  border-color: rgba(124, 92, 255, 0.16);
  color: #c4b5fd;
}

.hero-cat-chip:not(.hero-cat-chip--all):not(.hero-cat-chip--spotlight):not(.hero-cat-chip--recent):hover .hero-cat-icon {
  color: currentColor;
}

.hero-cat-icon svg {
  width: 17px;
  height: 17px;
  display: block;
}

.hero-cat-label {
  white-space: nowrap;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hero-aside {
  display: flex;
  flex-direction: column;
  gap: 12px;
  justify-content: center;
}

.hero-aside-card {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.2);
}

.hero-aside-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  background: rgba(0, 181, 255, 0.1);
  color: #7ee0ff;
  border: 1px solid rgba(0, 181, 255, 0.2);
}

.hero-aside-icon svg {
  width: 20px;
  height: 20px;
}

.hero-aside-title {
  margin: 0 0 4px;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text);
}

.hero-aside-text {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.45;
}

.legal-kicker {
  margin: 0 0 10px;
  color: #85d9ff;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.82rem;
}

.search-hideable {
  opacity: 1;
  transform: translateY(0);
  max-height: 1200px;
  overflow: hidden;
  transition: opacity 0.24s ease, transform 0.24s ease, max-height 0.28s ease, margin 0.24s ease, padding 0.24s ease, border-width 0.24s ease;
}

.search-hideable.is-search-hidden {
  opacity: 0;
  transform: translateY(-8px);
  max-height: 0;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  border-width: 0 !important;
  pointer-events: none;
}

body.search-mode .main-content {
  padding-top: 0;
}

body.search-mode .topbar {
  position: sticky;
  top: 10px;
  z-index: 20;
  background: #10131c;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
}

body.search-mode #categoriesSections .games-section {
  display: block !important;
}

.search-results-section {
  margin-bottom: 22px;
}

/* —— Dedicated category page + numbered pager —— */
.category-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
  padding: 0.35rem 0 0.75rem;
  font-size: 0.88rem;
  color: var(--muted, #9aa3b2);
}

.category-breadcrumb a {
  color: var(--accent, #7c5cff);
  text-decoration: none;
}

.category-breadcrumb a:hover {
  text-decoration: underline;
}

.category-breadcrumb__sep {
  opacity: 0.45;
  user-select: none;
}

.category-page-section {
  margin-top: 0.25rem;
}

.category-page-heading {
  margin: 0 0 0.25rem;
  font-size: 1.45rem;
  letter-spacing: -0.02em;
}

.category-page-meta {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted, #9aa3b2);
}

.category-page-empty {
  margin: 1.5rem 0;
}

.category-pager-host {
  display: flex;
  justify-content: center;
  padding: 1.25rem 0 2rem;
}

/* Compact pager (same pattern as admin dashboard games library) */
.category-pager-host .pager-compact.category-pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  width: 100%;
  max-width: 42rem;
  justify-content: center;
}

.category-pager-host .pager-compact .page-btn {
  box-sizing: border-box;
  min-width: 2.25rem;
  height: 2.25rem;
  padding: 0 0.5rem;
  border-radius: 10px;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line, rgba(255, 255, 255, 0.08));
  color: var(--muted, #9aa3b2);
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.category-pager-host .pager-compact a.page-btn:hover {
  color: var(--text, #e8ecf5);
  border-color: rgba(255, 255, 255, 0.14);
}

.category-pager-host .pager-compact .page-btn.active {
  color: var(--accent, #7c5cff);
  border-color: rgba(124, 92, 255, 0.45);
  background: rgba(124, 92, 255, 0.12);
}

.category-pager-host .pager-compact .page-btn--disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

.category-pager-host .pager-compact .page-btn--edge {
  min-width: auto;
  padding: 0 0.6rem;
  font-size: 0.76rem;
}

.category-pager-host .pager-compact .pager-gap {
  padding: 0 0.1rem;
  color: var(--muted, #9aa3b2);
  font-size: 0.85rem;
  user-select: none;
}

.category-pager-host .pager-compact .pager-summary {
  margin-left: auto;
  font-size: 0.76rem;
  color: var(--muted, #9aa3b2);
}

@media (max-width: 560px) {
  .category-pager-host .pager-compact .pager-summary {
    width: 100%;
    margin-left: 0;
    margin-top: 0.35rem;
    text-align: center;
  }
}

.site-pager {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: center;
  align-items: center;
}

.site-page-btn {
  min-width: 2.35rem;
  height: 2.35rem;
  padding: 0 0.45rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--muted, #9aa3b2);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line, rgba(255, 255, 255, 0.08));
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.site-page-btn:hover {
  color: var(--text, #e8ecf5);
  border-color: rgba(255, 255, 255, 0.14);
}

.site-page-btn--active {
  color: var(--accent, #7c5cff);
  border-color: rgba(124, 92, 255, 0.45);
  background: rgba(124, 92, 255, 0.12);
}