html {
  scrollbar-width: none;
}

html::-webkit-scrollbar {
  width: 0;
}

body > .os-scrollbar-vertical {
  display: none !important;
}

#header {
  border-bottom: 0 !important;
}

.home-moment-link {
  position: absolute;
  z-index: 2;
  inset: 0;
  border-radius: inherit;
}

.home-moment-strip .home-moment-link:focus-visible {
  outline-offset: -2px;
}

.home-moment-strip .swiper-slide > div {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.home-moment-strip .swiper-slide > div :is(p, span, a, strong, em) {
  display: inline;
  font: inherit !important;
  color: inherit !important;
  background: transparent !important;
}

.home-moment-strip .swiper-slide br {
  display: none;
}

.tag-index-title {
  margin-bottom: 1rem;
  font-size: 1.25rem;
  font-weight: 600;
}

@media (max-width: 767px) {
  html {
    --mobile-gutter: clamp(0.875rem, 4vw, 1.25rem);
    --mobile-section-gap: clamp(1.125rem, 5vw, 1.5rem);
    --mobile-rule: color-mix(in srgb, var(--border-color) 75%, transparent);
    scroll-padding-top: 3.75rem;
  }

  .site-content {
    gap: var(--mobile-section-gap);
    padding: 1rem var(--mobile-gutter) calc(4.5rem + env(safe-area-inset-bottom, 0px));
  }

  #header {
    height: auto;
    min-height: 3.5rem;
    padding: 0 var(--mobile-gutter);
    transition: transform 200ms cubic-bezier(0.2, 0.75, 0.3, 1);
  }

  #header[data-scroll-hidden] {
    transform: translateY(-100%);
  }

  #header:not([data-header-transparent="true"]),
  html.dark #header:not([data-header-transparent="true"]) {
    background-color: color-mix(in srgb, var(--bg-surface) 86%, transparent) !important;
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
  }

  .site-header-inner {
    gap: 0.25rem;
  }

  #header .site-header-brand,
  #header .site-header-actions,
  #header .site-header-actions > div {
    height: auto;
  }

  .site-header-brand {
    min-width: 0;
  }

  .site-header-brand > a {
    min-width: 0;
    min-height: 2.75rem;
    gap: 0.5rem;
  }

  .site-header-brand > a > img {
    width: 2rem;
    height: 2rem;
    flex: none;
    object-fit: contain;
  }

  .site-header-brand > a > div {
    font-size: 1.0625rem;
    font-weight: 650;
    line-height: 1.35;
  }

  .site-header-actions {
    flex-shrink: 0;
    gap: 0.125rem;
  }

  .site-header-actions > div {
    display: flex;
    align-items: center;
  }

  #header .site-header-actions > div.hidden {
    display: none;
  }

  #header .mobile-handle-btn,
  #header .mobile-drawer .close-btn {
    display: grid;
    min-width: 2.75rem;
    min-height: 2.75rem;
    place-items: center;
  }

  #header .mobile-handle-btn {
    color: inherit;
    transition: none;
  }

  #header .mobile-handle-btn:focus-visible,
  #header .mobile-drawer .close-btn:focus-visible {
    outline: 2px solid var(--accent) !important;
    outline-offset: -2px;
  }

  #header .mobile-drawer {
    max-width: min(86vw, 20rem) !important;
    height: 100dvh !important;
    background: var(--bg-surface) !important;
    color: var(--text-main);
  }

  .mobile-drawer .menu-link,
  .mobile-drawer .submenu-item a {
    min-height: 2.75rem;
  }

  .game-home {
    gap: var(--mobile-section-gap);
  }

  .latest-recommendations > h2,
  .popular-games > h2,
  .game-catalog-heading > h2 {
    font-size: 1.125rem;
    font-weight: 650;
    line-height: 1.4;
  }

  .latest-recommendations-list,
  .popular-games-list {
    scrollbar-color: var(--border-color) transparent;
  }

  .latest-recommendations-list {
    gap: 0.625rem;
    padding-bottom: 0.1875rem;
  }

  .latest-recommendation {
    border-color: var(--mobile-rule);
    border-radius: 0.75rem;
  }

  html .game-home .home-moment-strip {
    min-height: 2.75rem;
    padding: 0.5rem 0.125rem;
    border: 0;
    border-radius: 0;
    background: transparent !important;
    color: var(--text-muted);
    font-weight: 500;
    transition: none;
  }

  .home-moment-strip > :last-child {
    opacity: 0.82;
  }

  .popular-games {
    border: 0;
    border-radius: 0;
    padding: 0;
    background: transparent;
  }

  .popular-games-list {
    gap: 0.875rem;
    margin-top: 0.5rem;
    padding-bottom: 0.1875rem;
  }

  .popular-games-cover {
    border-radius: 0.8125rem;
  }

  .game-library {
    gap: 0.75rem;
    scroll-margin-top: 0.375rem;
  }

  .game-library #filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.125rem 0.375rem;
    padding: 0;
    border: 0;
    background: transparent !important;
  }

  .game-library #filters:not(:has(.category-submenu-toggle)) {
    flex-wrap: nowrap;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
  }

  .game-library #filters > li {
    display: flex;
    flex: none;
    align-items: center;
    max-width: 100%;
  }

  .game-library #filters > li > a {
    flex: none;
    min-height: 2.75rem;
    padding-inline: 0.75rem;
    border-radius: 999px;
    background: var(--bg-muted);
    color: var(--text-main);
    transition: none;
  }

  .game-library #filters > li > a[aria-current="page"],
  .game-library #filters > li:has(.category-submenu [aria-current="page"]) > a {
    background: color-mix(in srgb, var(--accent) 17%, var(--bg-surface));
    font-weight: 700;
  }

  .game-library #filters > li > a > span {
    overflow: hidden;
    max-width: min(11.5rem, 54vw);
    white-space: nowrap;
  }

  .game-library #filters > li:has(> .category-submenu-toggle.is-open) {
    flex: 1 1 100%;
    flex-wrap: wrap;
  }

  .game-library #filters .category-submenu {
    position: static;
    flex: 1 1 100%;
    max-width: 100%;
    padding: 0;
    border: 0;
    background: transparent !important;
    box-shadow: none;
  }

  .game-library #filters .category-submenu a {
    display: flex;
    min-height: 2.75rem;
    align-items: center;
    padding-inline: 0.75rem;
  }

  .game-catalog-heading {
    gap: 0.5rem;
    margin-bottom: 0.375rem;
  }

  .game-catalog-heading > button {
    flex: 0 1 auto;
    gap: 0.5rem;
    max-width: 64%;
    padding-inline: 0.75rem;
    border-radius: 999px;
    background: var(--bg-muted);
    color: var(--text-main);
  }

  .game-library .game-post-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 0.75rem;
    row-gap: 0;
  }

  .game-library .game-post-list .game-post-card {
    border: 0;
    border-bottom: 1px solid var(--mobile-rule);
    border-radius: 0;
    background: transparent !important;
    color: var(--text-main);
    transition: none;
  }

  .game-library .game-post-card > div {
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.75rem 0;
  }

  .game-library .game-post-card .post-card-media {
    width: clamp(2.75rem, 12vw, 3.5rem) !important;
    height: clamp(2.75rem, 12vw, 3.5rem) !important;
    border-radius: 0.625rem;
  }

  .game-library .game-post-card .post-card-copy > a {
    justify-content: flex-start;
    gap: 0.25rem;
    min-height: 2.75rem;
    transition: none;
  }

  .game-library .game-post-card .post-card-copy h3 {
    display: -webkit-box;
    overflow-wrap: break-word;
    word-break: normal;
    white-space: normal;
    line-height: 1.35;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .game-library .game-post-card .post-card-copy h3 > span:not(.post-card-pin) {
    font-size: clamp(0.8125rem, 2vw + 0.4rem, 0.9375rem);
    font-weight: 600;
  }

  .game-library .game-post-card .post-card-copy > a > span {
    display: -webkit-box;
    overflow-wrap: break-word;
    word-break: normal;
    white-space: normal;
    line-height: 1.5;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  html .site-content :is(.content-pagination, .game-catalog-empty, .site-tags, .category-index,
    .archive-posts > .rounded-lg, .reading-surface, .moments-entry, .moments-empty),
  html .article-title-panel:not(.has-cover) {
    border: 0;
    border-radius: 0;
    background: transparent !important;
  }

  .content-pagination,
  .site-tags,
  .category-index,
  .archive-month,
  .reading-surface {
    padding-inline: 0;
  }

  .content-pagination {
    color: var(--text-muted);
  }

  .content-pagination a[aria-label] {
    width: 2.75rem;
    height: 2.75rem;
  }

  .content-pagination .pagination-stepper {
    border-color: var(--mobile-rule);
  }

  .content-pagination .pagination-page {
    min-height: 2.75rem;
    height: auto;
  }

  .content-pagination .custom-select {
    min-width: 3.5rem;
    min-height: 2.75rem;
    border-color: var(--mobile-rule);
    background: var(--bg-surface);
    color: var(--text-main);
  }

  html.dark .content-pagination .custom-select {
    background: var(--bg-surface);
    color: var(--text-main);
  }

  .site-tags a {
    min-height: 2.75rem;
  }

  .tag-index-title {
    font-size: 1.125rem;
  }

  .tag-index-list {
    gap: 0.5rem;
  }

  .tag-index-list a {
    min-height: 2.75rem;
    border: 0;
    background: var(--bg-surface-2) !important;
    color: var(--text-main);
  }

  .site-friendship-links {
    gap: 0.5rem;
    padding: 0;
  }

  .site-friendship-links a {
    min-height: 2.75rem;
  }

  .article-navigation {
    gap: 0.25rem;
  }

  .article-navigation > div {
    justify-content: flex-start;
    min-width: 0;
  }

  .article-navigation a {
    min-height: 2.75rem;
    min-width: 0;
    color: var(--text-muted);
    line-height: 1.5;
    white-space: normal;
  }

  .article-navigation a svg {
    flex: none;
  }

  .article-navigation a span {
    overflow-wrap: anywhere;
  }

  .category-index-entry {
    border: 0;
    padding-inline-start: 0;
  }

  .category-index-list > .category-index-entry + .category-index-entry {
    margin-top: 0.25rem;
  }

  .category-index-entry > a {
    min-height: 2.75rem;
    padding-inline: 0;
  }

  .archive-month {
    border-inline-start: 0;
  }

  .archive-posts > .rounded-lg,
  .moments-entry {
    border-bottom: 1px solid var(--mobile-rule);
  }

  .reading-surface {
    min-width: 0;
    padding-block: 0;
  }

  .article-title-inner {
    gap: 0.75rem;
    padding: 1.375rem var(--mobile-gutter) 0;
  }

  .article-title-panel.has-cover .article-title-inner {
    padding-block: 1.75rem;
  }

  .reading-page-title,
  .article-title-inner > h1 {
    overflow-wrap: break-word;
    word-break: normal;
    font-size: clamp(1.375rem, 1.1rem + 1.5vw, 1.75rem);
    line-height: 1.35;
    text-align: start;
    text-wrap: balance;
  }

  .reading-page-title {
    margin-bottom: 1rem;
    padding-bottom: 0;
    border: 0;
  }

  .article-meta {
    padding-inline-start: 0;
    font-size: 0.8125rem;
    opacity: 1;
  }

  .article-title-panel:not(.has-cover) .article-meta {
    color: var(--text-muted);
  }

  .reading-surface .markdown-body,
  .moments-entry .markdown-body {
    background: transparent;
    color: var(--text-main);
    font-size: 1rem;
    line-height: 1.75;
  }

  .reading-surface .markdown-body :is(img, video, iframe),
  .moments-entry :is(img, video, iframe) {
    max-width: 100%;
  }

  .reading-surface .markdown-body a {
    overflow-wrap: anywhere;
  }

  .moments-entry {
    min-width: 0;
    padding-inline: 0;
  }

  .moments-empty {
    padding-inline: var(--mobile-gutter);
  }

  .moments-empty-illustration {
    display: none;
  }

  .moments-empty h2 {
    margin-top: 0;
    color: var(--text-main);
  }

  .moments-empty a {
    display: inline-flex;
    min-height: 2.75rem;
    align-items: center;
  }

  #btn-scroll-to-top {
    right: max(0.75rem, env(safe-area-inset-right));
    bottom: max(0.875rem, env(safe-area-inset-bottom));
    width: 2.75rem;
    height: 2.75rem;
    align-items: center;
    justify-content: center;
    padding: 0.625rem;
    border: 1px solid var(--border-color);
    background-color: var(--bg-surface);
    color: var(--text-main);
  }

  #btn-scroll-to-top:not(.pointer-events-none) {
    opacity: 1;
  }

  #btn-scroll-to-top svg {
    color: inherit;
  }
}

@media (max-width: 767px) and (prefers-reduced-motion: reduce) {
  #header {
    transition: none;
  }
}

@media (max-width: 767px) {
  .latest-recommendations-list,
  .popular-games-list,
  .game-library #filters:not(:has(.category-submenu-toggle)) {
    scrollbar-width: none;
  }

  .latest-recommendations-list::-webkit-scrollbar,
  .popular-games-list::-webkit-scrollbar,
  .game-library #filters:not(:has(.category-submenu-toggle))::-webkit-scrollbar {
    display: none;
  }
}
