/* The home, profile and desktop ranking cards share one permanent map-side stage. */
body[data-map-home="true"] { --map-card-left: 24px; --map-card-bottom: 36px; --map-card-width: min(374px, calc(100vw - 48px)); }
body[data-map-home="true"] #top-bar { z-index: 1600; }
.map-home-panel,
body[data-map-home="true"] .artist-profile-panel,
body[data-map-home="true"] #rank-panel {
  position: fixed; top: var(--map-panel-top, 78px); bottom: var(--map-card-bottom); left: var(--map-card-left); right: auto;
  width: var(--map-card-width); height: auto; max-height: none; box-sizing: border-box; border: 1px solid #ffffffd9; border-radius: 28px;
}
.map-home-panel {
  z-index: 1250; display: flex; flex-direction: column; overflow: hidden; background: #faf8f5; color: #191919;
  box-shadow: 0 14px 50px #30251c24, 0 2px 8px #30251c0a; font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
  animation: home-panel-enter .28s ease-out both;
}
.map-home-panel[hidden], .map-home-panel [hidden] { display: none !important; }
.map-home-panel, .map-home-panel * { box-sizing: border-box; }
.map-home-panel button, .map-home-panel a { -webkit-tap-highlight-color: transparent; font-family: inherit; }
.map-home-panel :focus-visible { outline: 2px solid #e60012; outline-offset: 3px; }
.map-home-panel.is-covered { pointer-events: none; }
.home-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.home-panel-scroll { position: relative; min-height: 0; flex: 1; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #d8d0c6 transparent; }
.home-panel-collapse { position: absolute; right: 12px; top: 12px; z-index: 5; display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 1px solid #ffffff9c; border-radius: 50%; background: transparent; color: #fff; cursor: pointer; box-shadow: 0 2px 9px #00000012; transition: background .18s ease; }
.home-panel-collapse:hover { background: transparent; }
.home-panel-collapse svg { width: 16px; height: 16px; pointer-events: none; transition: transform .22s ease; }
.map-home-panel.is-collapsed .home-panel-collapse svg { transform: rotate(180deg); }

/* Keep a 4:3 artwork window, with artist shortcuts outside the work's link hit area. */
.home-release-carousel { position: relative; width: 100%; aspect-ratio: 4 / 3; isolation: isolate; background: #cf0015; overflow: hidden; touch-action: pan-y; }
.home-release-slides, .home-release-open, .home-release-empty { position: absolute; inset: 0; width: 100%; height: 100%; }
.home-release-slides { display: flex; transform: translate3d(0, 0, 0); transition: transform .46s cubic-bezier(.22, .72, .22, 1); will-change: transform; }
.home-release-slides.is-resetting { transition: none; }
.home-release-slide { position: relative; flex: 0 0 100%; width: 100%; height: 100%; isolation: isolate; }
.home-release-open { display: block; padding: 0; border: 0; text-align: left; color: #fff; text-decoration: none; background: linear-gradient(135deg, #b80019, #ef5b40); cursor: pointer; }
.home-release-image { position: absolute; inset: 0; display: block; background: linear-gradient(145deg, #a40c24, #c6311e 70%, #ae071c); }
.home-release-image img { width: 100%; height: 100%; object-fit: cover; display: block; }
.home-release-image img[hidden] { display: none; }
.home-release-image-pending { position: absolute; top: 21px; right: 78px; padding: 4px 7px; border: 1px solid #ffffff40; border-radius: 6px; color: #ffffffb3; font-size: 10px; line-height: 1.2; letter-spacing: .5px; }
.home-release-shade { position: absolute; inset: 0; background: linear-gradient(180deg, #0002 0%, #0000 35%, #0004 64%, #000c 100%); }
.home-release-copy { position: absolute; left: 20px; right: 102px; bottom: 22px; text-align: left; }
.home-release-type { display: inline-block; margin-bottom: 8px; padding: 3px 8px; border: 0; border-radius: 3px; background: #0008; color: #fff; font-size: 11px; font-weight: 600; line-height: 1.45; text-shadow: none; }
.home-release-title { margin: 0; color: #fff; font-size: 20px; font-weight: 800; line-height: 1.35; letter-spacing: -.3px; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; text-wrap: pretty; text-shadow: 0 2px 16px #0005; }
.is-single .home-release-copy { right: 20px; z-index: 2; }
.is-single .home-release-title { display: block; overflow: visible; }
.home-release-artists-row { display: flex; align-items: center; flex-wrap: nowrap; width: max-content; max-width: 100%; font-size: 16px; line-height: 1.5; white-space: nowrap; }
.home-release-artists-row .home-release-artist { flex-shrink: 0; }
.home-release-song-line { display: block; margin-top: 4px; }
.home-release-title-link { padding: 0; border: 0; color: inherit; background: transparent; font: inherit; text-align: inherit; text-decoration: none; cursor: pointer; }
.home-release-title-separator { padding: 0 3px; color: #ffffffbf; }
.home-release-artist { display: inline-flex; align-items: center; gap: 5px; margin: 0 2px 0 0; padding: 0; border: 0; color: inherit; background: transparent; font: inherit; text-align: left; white-space: nowrap; vertical-align: middle; cursor: pointer; }
.home-release-artist:disabled { opacity: .65; cursor: default; }
.home-release-artist-avatar { position: relative; display: flex; align-items: center; justify-content: center; flex: 0 0 22px; width: 22px; height: 22px; border-radius: 50%; background: #eee4db; color: #9e8b7b; font-size: 12px; font-weight: 800; overflow: hidden; }
.home-release-artist-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; object-fit: cover; }
.home-release-artist-name { white-space: nowrap; }
.home-carousel-controls { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.home-carousel-arrow { position: absolute; display: grid; place-items: center; padding: 0; color: #fff; opacity: 0; pointer-events: none; cursor: pointer; transition: opacity .18s ease; }
.home-carousel-arrow { top: 45%; width: 36px; height: 36px; border: 0; border-radius: 0; background: transparent; box-shadow: none; filter: drop-shadow(0 1px 3px #0008); transform: translateY(-50%); }
.home-carousel-previous { left: 10px; }
.home-carousel-next { right: 10px; }
.home-release-carousel:hover .home-carousel-arrow,
.home-carousel-arrow:focus-visible { opacity: 1; pointer-events: auto; }
.home-carousel-controls svg { width: 14px; height: 14px; pointer-events: none; }
.home-carousel-arrow svg { width: 20px; height: 20px; }
.home-carousel-dots { position: absolute; right: 14px; bottom: 12px; display: flex; align-items: center; pointer-events: auto; }
.home-carousel-dot { display: grid; place-items: center; width: 16px; height: 28px; padding: 0; border: 0; border-radius: 6px; background: transparent; cursor: pointer; }
.home-carousel-dot::before { content: ''; width: 8px; height: 8px; box-sizing: border-box; border: 1px solid #ffffffe0; border-radius: 50%; background: transparent; }
.home-carousel-dot[aria-current="true"]::before { border-color: #fff; background: #fff; }
.home-carousel-dot:hover::before { border-color: #fff; }
.home-carousel-dot:focus-visible { outline-color: #fff; }
.home-release-status { position: absolute; top: 62px; left: 18px; right: 18px; z-index: 3; margin: 0; padding: 0; color: #fff; background: #241814d9; border-radius: 10px; font-size: 11px; line-height: 1.6; pointer-events: none; }
.home-release-status:not(:empty) { padding: 9px 12px; }
.home-release-empty { overflow: hidden; background: radial-gradient(ellipse at 85% 75%, #ffb395 0, transparent 48%), linear-gradient(135deg, #b8001c, #eb342d 64%, #f0734e); color: #fff; }
.home-release-empty::before { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(125deg, transparent 0 52px, #ffffff0a 53px 54px); }
.home-empty-kicker { position: absolute; left: 22px; top: 25px; font-size: 10px; letter-spacing: 1px; color: #ffffffbf; }
.home-empty-title { position: absolute; left: 20px; top: 51px; z-index: 2; margin: 0; font-size: 40px; line-height: 1.15; letter-spacing: -2px; font-weight: 900; }
.home-empty-record { position: absolute; width: 68%; aspect-ratio: 1; right: -12%; bottom: -7%; border: 1px solid #ffffff24; border-radius: 50%; background: radial-gradient(circle, #fff5e6 0 3%, #d41429 3.5% 15%, #2c1c20 15.5% 18%, transparent 18.5%), repeating-radial-gradient(circle, #251b20 0 2px, #463237 3px 4px); box-shadow: -12px 20px 45px #5a001a5c; transform: rotate(-18deg); }
.home-empty-note { position: absolute; bottom: 29px; left: 22px; z-index: 2; max-width: 58%; margin: 0; font-size: 12px; line-height: 1.7; color: #ffffffe6; }

/* These are the original filter nodes, so every entry shares the map's existing state. */
.home-filter-section { margin: 12px 13px 14px; padding: 20px 15px 16px; outline: none; }
.home-filter-heading { margin: 0 0 16px; color: #221e1a; font-size: 17px; line-height: 1.4; font-weight: 850; }
.map-home-panel #mode-filter-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; height: 40px; min-width: 0; margin: 0 0 10px; padding: 3px; position: relative; background: #f1eeea; border-radius: 12px; box-shadow: none; }
.map-home-panel #mode-filter-tabs::before, .map-home-panel #mode-filter-tabs::after, .map-home-panel .mode-filter-slider { display: none; }
#map-home-panel #mode-filter-tabs .filter-btn { display: flex; justify-content: center; align-items: center; position: static; width: auto; min-width: 0; height: 34px; padding: 0 3px; margin: 0; border: 0; border-radius: 9px; color: #8b8177; background: transparent; box-shadow: none; font-size: 12px; transform: none; }
#map-home-panel #mode-filter-tabs .filter-btn.active { background: #e60012; color: #fff; }
.map-home-panel #more-options-dropdown { display: flex; position: static !important; inset: auto !important; width: 100% !important; max-height: none !important; padding: 0; overflow: visible; opacity: 1; pointer-events: auto; transform: none; transition: none; border: 0; border-radius: 0; background: transparent; box-shadow: none; backdrop-filter: none; }
.map-home-panel #more-options-dropdown .dots-only-option { min-height: 44px; padding: 10px 0; border-color: #f0ece7; color: #655a50; font-size: 12px; }
.map-home-panel #more-options-dropdown .fan-threshold-control { padding: 14px 0 12px; border-color: #f0ece7; color: #655a50; }
.map-home-panel .fan-threshold-heading { font-size: 12px; }
.map-home-panel #more-options-dropdown .fan-threshold-labels { font-size: 9px; color: #aaa095; }
.map-home-panel #more-options-dropdown .dropdown-category-label { margin-top: 8px; padding: 13px 0 7px; border: 0; color: #a1968a; font-size: 10px; letter-spacing: 1px; }
.map-home-panel #more-options-dropdown .dropdown-item { min-height: 39px; padding: 10px 10px; border: 0; border-radius: 9px; color: #5e5147; font-size: 11px; line-height: 1.6; white-space: normal; text-align: left; background: transparent; }
.map-home-panel .dropdown-item.active { color: #e60012 !important; background: #fff0ee !important; }
.map-home-panel .dropdown-item:hover { color: #e60012; background: #fff8f5; }

body[data-map-home="true"] #rank-panel { z-index: 1450; background: #faf8f5; backdrop-filter: none; box-shadow: 0 14px 50px #30251c24, 0 2px 8px #30251c0a; }
.rank-card-toolbar { display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; padding: 18px 20px 3px; color: #191919; }
.rank-card-toolbar h2 { margin: 0; font-size: 22px; line-height: 1.3; font-weight: 850; }
body[data-map-home="true"] #rank-panel:not(.show) { visibility: hidden; }
body[data-map-home="true"] #rank-panel-body { overscroll-behavior: contain; }
@media (min-width: 481px) {
  body[data-map-home="true"] #search-input-wrap { grid-template-columns: minmax(210px, 280px) 44px max-content; }
}
@media (min-width: 481px) and (max-width: 740px) {
  body[data-map-home="true"] #search-input-wrap { grid-template-columns: minmax(0, 1fr) 44px; }
}
@media (max-width: 600px) {
  .map-home-panel, body[data-map-home="true"] .artist-profile-panel, body[data-map-home="true"] #rank-panel {
    top: auto; bottom: 0; left: 0; right: 0; width: 100%; height: 72dvh; max-height: 72dvh; border-bottom: 0; border-radius: 26px 26px 0 0;
  }
}
@media (max-width: 480px) {
  body[data-map-home="true"][data-mobile-navigation="v2"] .map-home-panel { display: none; }
  body[data-map-home="true"] #mobile-control-dialog #rank-panel { position: static !important; inset: auto !important; width: 100% !important; height: 100%; max-height: none; border: 0; border-radius: 0; box-shadow: none; background: transparent; }
  #mobile-control-dialog .rank-card-toolbar { display: none; }
  .home-release-title { font-size: 18px; }
  .home-release-artists-row { font-size: clamp(13px, 4.1vw, 16px); }
  .home-carousel-arrow { top: 34%; }
}
@media (hover: none) {
  .home-carousel-arrow { opacity: 1; pointer-events: auto; }
}
/* Collapse to the artwork, rather than hiding the permanent home card. */
body[data-map-home="true"] .map-home-panel.is-collapsed { bottom: auto; height: auto; max-height: calc(100dvh - var(--map-panel-top, 78px) - var(--map-card-bottom)); }
@media (min-width: 481px) and (max-width: 600px) {
  body[data-map-home="true"] .map-home-panel.is-collapsed { top: auto; bottom: 0; max-height: 72dvh; }
}
@media (prefers-reduced-motion: reduce) {
  .map-home-panel { animation: none; }
  .home-release-slides, .home-carousel-arrow, .home-panel-collapse, .home-panel-collapse svg { transition: none; }
}
@keyframes home-panel-enter { from { opacity: 0; transform: translateX(-10px); } to { opacity: 1; transform: translateX(0); } }
