/* Shared discovery cards: original difficulty fills, thin black outlines. */
.site-search {
  position: sticky;
  top: 0;
  z-index: 30;
  background: #f4f6faf5;
  border-bottom: 1px solid var(--line);
  padding: 9px max(20px, 5vw);
  backdrop-filter: blur(8px);
}
.site-search form {
  display: flex;
  gap: 9px;
  align-items: center;
  max-width: 1268px;
  margin: auto;
}
.site-search form > span {
  font-size: 26px;
}
.site-search input[type="search"] {
  flex: 1;
  min-width: 0;
  width: 100%;
  background: white;
  border: 1px solid #9ba8bc;
  border-radius: 7px;
  padding: 10px 12px;
  font-size: 16px;
  height: 44px;
}
.site-search button {
  height: 44px;
  flex: none;
}
.song-list-intro {
  margin-bottom: 15px;
}
.song-list-intro h2 {
  font-size: 28px;
  margin: 0;
}
.song-list-intro p {
  font-size: 13px;
}
.song-list-intro .count {
  font-size: 28px;
}
.song-filter-panel {
  position: relative;
  margin-bottom: 12px;
}
.song-filter-panel > summary {
  list-style: none;
  cursor: pointer;
  width: max-content;
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 13px;
  background: #fff;
  border: 1px solid #222b42;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 700;
  min-height: 40px;
}
.song-filter-panel > summary::-webkit-details-marker {
  display: none;
}
.song-filter-panel[open] > summary {
  background: #232d45;
  color: #fff;
}
.filter-count {
  font-size: 11px;
}
.song-filter-form {
  padding: 16px;
  background: #fff;
  border: 1px solid #99a5b7;
  border-radius: 9px;
  margin-top: 8px;
}
.song-filter-form fieldset {
  border: 0;
  padding: 0;
  margin: 0 0 14px;
  min-width: 0;
}
.song-filter-form legend {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 7px;
}
.filter-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.filter-chip {
  --chip: #d82060;
  background: #fff;
  border: 1px solid #b9c3d3;
  border-radius: 5px;
  color: #37435b;
  font-size: 12px;
  line-height: 1.4;
  padding: 8px 10px;
  min-height: 36px;
}
.filter-chip:hover {
  background: #f0f3f8;
  color: #222b42;
}
.filter-chip[aria-pressed="true"] {
  background: color-mix(in srgb, var(--chip) 28%, white);
  border: 1px solid #222b42;
  box-shadow: inset 0 0 0 1px var(--chip);
  color: #172036;
  font-weight: 700;
}
.filter-chip small {
  font-size: 10px;
}
.song-filter-form .filter-actions {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}
.song-filter-form .filter-actions a {
  font-size: 12px;
  text-decoration: underline;
}
.song-filter-form .notice {
  font-size: 11px;
}
.song-sort {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.song-sort label {
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 5px;
}
.song-sort select {
  font-size: 12px;
  margin: 0;
  padding: 6px 23px 6px 7px;
  height: 36px;
  max-width: 160px;
}
.song-sort .sort-direction {
  font-size: 18px;
  padding: 0;
  width: 36px;
  height: 36px;
  background: #fff;
  border: 1px solid #758197;
  color: #222b42;
  border-radius: 5px;
}
.song-sort select:disabled {
  color: #687386;
  background: #e5e8ed;
  border-color: #bac2ce;
  opacity: 1;
  cursor: not-allowed;
}
.song-sort label:has(select:disabled) {
  color: #687386;
}
.song-grid,
.cross-search-list.song-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.song-card,
.creator-record {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-width: 0;
  border: 1px solid #1a1a1a;
  border-radius: 8px;
  padding: 9px 12px 8px;
  background: color-mix(in srgb, var(--band) 20%, white);
}
.band-motif {
  position: absolute;
  pointer-events: none;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  height: calc(100% - 8px);
  max-height: 94px;
  width: 160px;
  background: var(--band);
  opacity: 0.21;
  mask-image: var(--motif);
  mask-position: center;
  mask-repeat: no-repeat;
  mask-size: contain;
  -webkit-mask-image: var(--motif);
  -webkit-mask-position: center;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-size: contain;
  z-index: 0;
}
.song-card > .song-heading,
.song-card > .game-label,
.song-card > .song-sort-metric,
.song-card > .song-difficulties,
.creator-record > .creator-record-heading,
.creator-record > .creator-record-meta {
  position: relative;
  z-index: 1;
}
.song-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}
.song-sort-metric {
  margin: 3px 0 0;
  color: #37435b;
  font-size: 12px;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.song-card .song-title {
  flex: 1;
  min-width: 0;
  display: block;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.5;
  white-space: normal;
  text-decoration: none;
  overflow-wrap: anywhere;
  max-width: none;
  padding: 0;
}
.song-card .song-title-text {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
}
.song-card[data-game="ournotes"] .song-list-type-dot {
  display: inline-block;
  box-sizing: content-box;
  width: 10px;
  height: 10px;
  border: 1.5px solid #fff;
  border-radius: 50%;
  background: var(--song-type-color);
  box-shadow: 0 0 0 1px #000;
  margin-right: 6px;
  vertical-align: -1px;
}
.title-phrase {
  display: inline-block;
  white-space: pre-wrap;
  max-width: 100%;
  overflow-wrap: anywhere;
}
.song-card .tag {
  flex: none;
  font-size: 10px;
  line-height: 1.6;
  padding: 2px 6px;
  white-space: nowrap;
  background: #ffffffd9;
  border: 1px solid #59657b55;
  border-radius: 4px;
}
.song-card .game-label,
.creator-record .game-label {
  display: table;
  width: max-content;
  font-size: 10px;
  line-height: 1.5;
  font-weight: 700;
  border-radius: 3px;
  padding: 1px 6px;
  margin: 3px 0 0;
}
.game-label.garupa {
  background: #fff0f5;
  color: #b71c55;
}
.game-label.ournotes {
  background: #edf4ff;
  color: #2868ce;
}
.song-difficulties {
  display: grid;
  grid-template-columns: repeat(var(--columns), minmax(0, 1fr));
  margin: 5px 0 0;
  gap: 0;
}
.song-difficulties > div {
  min-width: 0;
  text-align: center;
}
.song-difficulties dt {
  font-size: 11px;
  line-height: 1.4;
  font-weight: 800;
  letter-spacing: 0.02em;
  -webkit-text-stroke: 0.35px #000;
  paint-order: stroke fill;
  text-shadow:
    -0.35px -0.35px 0 #000,
    0.35px -0.35px 0 #000,
    -0.35px 0.35px 0 #000,
    0.35px 0.35px 0 #000;
}
.song-difficulties .lv {
  color: #000;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.25;
  padding: 0;
  margin: 1px 0 0;
  font-variant-numeric: tabular-nums;
}
.cross-search-heading {
  font-size: 28px;
  margin: 0 0 18px;
}
.home-entry {
  display: block;
  text-decoration: none;
}
.game-cards .panel a.home-entry {
  text-decoration: none;
}
.game-cards > .panel,
.home-search {
  position: relative;
}
.home-entry::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
}
.home-game-entry .home-entry h2 {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.home-entry h2 {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  margin: 0 0 12px;
}
.home-entry h2 > span {
  font-weight: 400;
  flex: none;
  font-size: 18px;
}
.home-entry p {
  margin: 8px 0;
  font-size: 14px;
  color: #000;
}
.home-entry .song-update {
  text-align: right;
  color: #000;
  font-size: 12px;
  margin: 18px 0 0;
}
.home-search {
  border-top: 3px solid #d82060;
  background: #fff6fa;
}
.home-search h2 {
  font-size: 25px;
  color: #b71f58;
}
.home-game-entry {
  border-top: 3px solid var(--game-accent);
}
.home-game-entry h2 {
  font-size: 18px;
}
@media (max-width: 800px) {
  .song-grid,
  .cross-search-list.song-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 7px;
  }
  .song-card {
    padding: 8px 11px 7px;
  }
  .song-difficulties dt {
    font-size: 10px;
    letter-spacing: 0;
  }
  .song-difficulties .lv {
    font-size: 18px;
  }
  .song-list-intro h1,
  .song-list-intro h2 {
    font-size: 22px;
  }
  .song-list-intro p {
    font-size: 11px;
  }
  .song-list-intro .count {
    font-size: 23px;
  }
  .song-sort {
    gap: 7px;
  }
  .song-sort label {
    font-size: 10px;
  }
  .song-sort select {
    font-size: 11px;
    max-width: 126px;
  }
  .song-filter-form {
    padding: 12px;
  }
  .filter-chip {
    font-size: 11px;
    padding: 8px;
    min-height: 36px;
  }
  .site-search {
    padding: 8px 16px;
  }
  .site-search form > span {
    display: none;
  }
  .site-search button {
    padding: 8px 13px;
    font-size: 13px;
  }
  .home-game-entry h2 {
    font-size: 16px;
  }
  .home-entry p {
    font-size: 13px;
  }
  .home-entry .song-update {
    font-size: 11px;
  }
  .song-list-intro {
    gap: 8px;
  }
}

.song-difficulties dt {
  margin: 0;
  -webkit-text-stroke: 0.35px #000;
  text-shadow:
    -0.2px -0.2px 0 #000,
    0.2px -0.2px 0 #000,
    -0.2px 0.2px 0 #000,
    0.2px 0.2px 0 #000;
}
@media (max-width: 800px) {
  .song-difficulties dt {
    font-size: 11px;
  }
  .song-sort {
    align-items: end;
  }
  .song-sort label {
    display: grid;
    white-space: nowrap;
    gap: 3px;
  }
  .song-sort label:first-of-type select {
    width: 116px;
  }
  .song-sort label:nth-of-type(2) select {
    width: 94px;
  }
  .song-sort .sort-direction {
    width: 32px;
  }
}

.song-card .search-detail {
  flex: 1;
  min-width: 0;
  display: block;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.5;
  white-space: normal;
  overflow-wrap: anywhere;
  text-decoration: none;
}

.song-tags,
.limited-badges {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
}
.song-heading .song-tags {
  justify-content: flex-end;
  max-width: 100%;
}
.tag.limited {
  background: #e9e4ff;
  color: #46337c;
}
.tag.availability-expired {
  background: #edeef2;
  color: #353b49;
  border: 1px solid #a5aab5;
}
.expired-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  margin: 12px 0;
}
.expired-toggle input {
  width: 18px;
  height: 18px;
  accent-color: #6454a4;
}
.limited-counts {
  line-height: 1.8;
  font-size: 14px;
}
.limited-history p {
  overflow-wrap: anywhere;
}
@media (max-width: 600px) {
  .song-heading:has(.limited-badges) {
    flex-direction: column;
    align-items: stretch;
  }
  .song-heading:has(.limited-badges) .song-tags {
    justify-content: flex-start;
  }
}
