/* Theme entrypoint.
   Page styles should link this once after their regular CSS. New themes should
   only need token values in theme-tokens.css plus registration in theme.js and
   server/constants/themes.js. */
@import url("/themes/theme-tokens.css?v=20261019-touch-controls-v2");
@import url("/themes/theme-support.css?v=20261019-touch-controls-v2");
@import url("/themes/midnight-components.css?v=20261019-touch-controls-v2");
@import url("/themes/midnight-dashboard.css?v=20261014-garnet-approved");
@import url("/themes/midnight-controls.css?v=20261014-garnet-approved");
@import url("/themes/midnight-modals.css?v=20261019-touch-controls-v2");
@import url("/themes/red-components.css?v=20261014-garnet-approved");

/* Search result counts use plain text colors across all listing pages. */
:root[data-theme] :is(.games-result-summary, .levels-result-summary) span {
  color: #000000 !important;
}

:root[data-theme^="midnight"] :is(.games-result-summary, .levels-result-summary) span {
  color: #ffffff !important;
}

/* BBCode emphasis is gray; semantic headings keep their component colors. */
:root[data-theme] .bbcode-hover {
  color: inherit !important;
  font-weight: inherit;
  text-decoration-line: underline !important;
  text-decoration-style: dotted !important;
  text-underline-offset: 3px;
}

:root[data-theme] .bbcode-bold {
  color: #414141 !important;
}

:root[data-theme^="midnight"] .bbcode-bold {
  color: inherit !important;
}

/* Nested emphasis must follow the link's normal, hover, or account-role color. */
:root[data-theme] a:not(.level-source-row):not(.level-browse-thumb) :is(b, strong, .bbcode-bold) {
  color: inherit !important;
}

:root[data-theme] a.dashboard-list-item,
:root[data-theme] a.dashboard-list-item:is(:hover, :focus-visible) {
  color: var(--primary-dark);
  text-decoration: none;
}

/* Level names in legacy requests follow the theme's link text color. */
:root[data-theme] #legacy-panel .legacy-request-level-name {
  color: var(--theme-link-text, #2f5d84) !important;
}

/* Show the complete level image, including its square corners, in every theme. */
.level-detail-page .level-thumbnail-section .level-detail-thumb.has-thumbnail {
  overflow: visible !important;
}

.level-detail-page .level-thumbnail-section .level-detail-thumb-image {
  border-radius: 0 !important;
}

/* Favorite buttons are icon-only controls; themes may recolor them, but the
   hit target should stay circular across every palette. */
.favorite-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
  padding: 7px !important;
  border-radius: 50% !important;
  aspect-ratio: 1 / 1;
}

.favorite-btn.active,
.favorite-action .favorite-btn.active {
  background: linear-gradient(#b9d0e1, #98b8d0) !important;
  border-color: #467394 !important;
  box-shadow: 0 2px 5px rgba(47,85,110,0.2) !important;
}

.favorite-btn.active img,
.favorite-action .favorite-btn.active img {
  width: 18px;
  height: 18px;
  opacity: 1;
  filter: brightness(0) saturate(100%) invert(62%) sepia(96%) saturate(1022%) hue-rotate(357deg) brightness(101%) contrast(103%);
}
