.skeleton-shell { opacity: 0; animation: skeleton-reveal 0s 160ms forwards; pointer-events: none; }
@keyframes skeleton-reveal { to { opacity: 1; } }
.skeleton-shape {
  display: block;
  max-width: 100%;
  width: 100%;
  height: .85rem;
  border-radius: 6px;
  background: #2a2335;
  background-image: linear-gradient(110deg, transparent 36%, #bda2e31f 50%, transparent 64%);
  background-size: 250% 100%;
  animation: skeleton-shimmer 1.65s 160ms ease-in-out infinite;
}
@keyframes skeleton-shimmer { from { background-position: 100% 0; } to { background-position: -65% 0; } }
.skeleton-copy { display: grid; gap: .55rem; width: min(100%, 32rem); min-width: 0; }
.skeleton-title { width: min(100%, 19rem); height: clamp(1.7rem, 3.8vw, 2.8rem); margin-block: .2rem; }
.skeleton-short { width: 58%; }
.skeleton-back { width: 74px; height: 44px; margin-block-end: 12px; }
.skeleton-search { width: min(100%, 31rem); height: 46px; margin-block-start: .65rem; }
.skeleton-filters { display: flex; flex-wrap: wrap; gap: .55rem; margin-block-end: 1rem; }
.skeleton-filter { flex: 1 1 125px; height: 44px; }
.skeleton-art { height: clamp(135px,28vw,340px); }
.skeleton-icon { width: 62px; height: 62px; flex: 0 0 62px; }
.skeleton-preview {
  display: grid;
  gap: .45rem;
  justify-items: center;
  align-content: center;
  min-height: 104px;
  padding: .45rem .25rem;
  border-radius: 9px;
  background: var(--surface);
}
.skeleton-portrait { width: 56px; height: 56px; border-radius: 12px; }
.skeleton-avatar { width: 40px; height: 40px; border-radius: 50%; flex: 0 0 40px; }
.skeleton-account {
  display: flex;
  align-items: center;
  gap: .65rem;
  width: min(100%, 240px);
  padding: .5rem .75rem;
  border-radius: 8px;
  background: var(--raised);
}
.skeleton-profile-avatar { width: clamp(66px,12vw,112px); height: auto; aspect-ratio: 1; border-radius: 50%; flex-shrink: 0; }
.skeleton-player .skeleton-profile-avatar { width: 96px; }
.skeleton-player .uid-profile-stats .skeleton-shape { margin-block: .2rem; }
@media (max-width: 890px) {
  .skeleton-player .skeleton-profile-avatar { width: clamp(50px,15vw,74px); }
  .skeleton-player .uid-profile-stats > div { min-height: 75px; }
}
@media (max-width: 600px) {
  .skeleton-icon { width: 52px; height: 52px; flex-basis: 52px; }
}

#back-to-top {
  position: fixed;
  inset-inline-end: max(16px, calc(env(safe-area-inset-right) + 10px));
  inset-block-end: max(16px, calc(env(safe-area-inset-bottom) + 10px));
  z-index: 20;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 50%;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .2s ease, visibility .2s, background-color .18s, border-color .18s;
}
#back-to-top[data-visible] { opacity: 1; visibility: visible; pointer-events: auto; }
:root[data-mobile-drawer] #back-to-top,
body:has(dialog[open], #account-menu:not([hidden]), .database-nav[open], #game-tooltip:not([hidden])) #back-to-top {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: none;
}
@media (prefers-reduced-motion: reduce) {
  .skeleton-shape { animation: none; background-image: none; }
  #back-to-top { transition: none; }
}

/* Route placeholders stay in the same shell and use the same breakpoints as the content. */
@media (scripting: none) { .skeleton-boot { display: none; } }
.skeleton-list, .skeleton-tier-board { display: grid; gap: .55rem; }
.skeleton-list-grid, .skeleton-tile-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%, 220px),1fr)); gap: .65rem; }
.skeleton-list-row { display: flex; align-items: center; gap: .7rem; min-height: 74px; }
.skeleton-story { width: min(100%, 48rem); gap: .8rem; }
.skeleton-boot .skeleton-story { min-height: 180px; }
.skeleton-build { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); align-items: center; gap: 1rem; margin-bottom: .65rem; }
.skeleton-settings-layout { display: grid; grid-template-columns: minmax(0,230px) minmax(0,1fr); gap: .8rem; }
.skeleton-tier-row { display: grid; grid-template-columns: repeat(6,minmax(0,1fr)); gap: .45rem; align-items: center; }
.skeleton-home .home-hero-copy { width: min(100%, 680px); }
.skeleton-home .home-hero .skeleton-title { width: 90%; height: clamp(2.4rem,5.2vw,5rem); margin-block: .25em; }
.skeleton-home .home-hero .skeleton-search { margin-block-start: 1.25rem; }
.skeleton-home .home-discover-card { min-height: 122px; align-content: center; grid-template-rows: none; grid-template-columns: minmax(0,1fr); }
.skeleton-home .home-discover-account > .skeleton-short { width: min(100%, 145px); margin-bottom: .65rem; }
@media (max-width: 680px) {
  .skeleton-list-grid, .skeleton-settings-layout, .skeleton-build { grid-template-columns: minmax(0,1fr); }
  .skeleton-home .home-discover-card { min-height: 106px; }
  .skeleton-tier-row .skeleton-portrait { height: clamp(30px,8vw,56px); }
}
@media (max-width: 460px) {
  .skeleton-home .home-hero .skeleton-search { height: 98px; }
}

.skeleton-home .home-discover-grid .home-discover-card { box-sizing: border-box; }
.skeleton-home .home-hero .skeleton-line { width: min(90%, 30rem); }
