#content.shell:has(> .leyra-home) { max-width: none; width: min(var(--leyra-wide-page-max,1800px), calc(100% - 40px)); }
@media (max-width: 1050px) {
  #content.shell:has(> .leyra-home) { width: calc(100% - 28px); }
}
.leyra-home { display: grid; gap: clamp(24px, 4vw, 46px); }
.home-hero {
  isolation: isolate;
  position: relative;
  overflow: hidden;
  display: grid;
  align-items: center;
  min-height: clamp(350px, 37vw, 490px);
  border: 1px solid #443452;
  border-radius: 20px;
  background: radial-gradient(ellipse at 87% 35%, #523665 0%, #21192d 47%, #14111b 85%);
}
.home-landscape {
  position:absolute; z-index:-2; inset:0 0 0 22%; overflow:hidden;
}
.home-landscape img { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; object-position:72% 54%; }
.home-hero::after {
  content:''; position:absolute; z-index:-1; inset:0; pointer-events:none;
  background:linear-gradient(90deg,#15111d 8%,#15111df5 30%,#15111da0 51%,#15111d10 79%),
    linear-gradient(0deg,#100d1966 0%,transparent 32%);
}
.home-landscape-controls {
  position:absolute; bottom:20px; right:22px; display:flex; align-items:center;
  gap:.28rem; max-width:calc(100% - 32px); padding:4px 6px 4px 12px;
  background:#161122db; border:1px solid #d5bbf141; border-radius:999px; color:#f6eeff;
}
.home-landscape-location { display:grid; line-height:1.04; margin-inline-end:.34rem; min-width:6.25rem; }
.home-landscape-location > span { font-size:.57rem; letter-spacing:.16em; color:#e7d2fa; }
.home-landscape-location > strong { font-size:.76rem; margin-top:.16rem; }
.home-hero :is(.home-scene-dot,.home-scene-pause) {
  display:grid; place-items:center; min-height:28px; min-width:28px;
  background:none; border:0; color:inherit; border-radius:99px; padding:0;
}
.home-scene-dot::before { content:''; width:7px; height:7px; border:1px solid #dfcaf9aa; border-radius:50%; }
.home-scene-dot[aria-pressed="true"]::before { background:#e9d4ff; border-color:#e9d4ff; }
.home-scene-pause { font-size:.77rem; }
.home-hero :is(.home-scene-dot,.home-scene-pause):hover { background:#dfbaff23; }
.home-hero :is(.home-scene-dot,.home-scene-pause):focus-visible { outline:2px solid #f1dcff; outline-offset:0; }
.home-hero-copy { max-width: 680px; padding: clamp(22px, 5vw, 64px); }
.home-hero h1 { font-size: clamp(2.4rem, 5.2vw, 5rem); line-height: 1; letter-spacing: -.055em; margin: .25em 0; }
.home-hero h1 em { font-style: normal; color: var(--accent); }
.home-hero-copy > .home-hero-intro { color: #e2d9ec; font-size: clamp(1rem, 1.5vw, 1.17rem); }
.home-hero .hero-search { margin-block-start: 1.25rem; max-width: 560px; }
.home-hero .input-wrap { min-width: 0; background: #191323; }
.home-hero .input-wrap input { width: 100%; font-size: 1rem; }
.home-hero button { min-height: 46px; }
.home-hero-copy > .home-import-status { font-size: .85rem; margin: .55rem 0 0; }
.home-import-status:empty { margin: 0; }
.home-block { min-width: 0; }
.home-block h2 { margin: 0 0 .75rem; font-size: clamp(1.33rem, 2.3vw, 1.85rem); }
.home-block p { color: var(--muted); }
.home-section-heading { display: flex; gap: .5rem 1rem; align-items: baseline; justify-content: space-between; flex-wrap: wrap; }
.home-section-heading a, .home-text-link { color: var(--accent); font-weight: 650; }
.home-account, .home-features > a, .home-news-card {
  background: var(--surface);
  border-radius: 12px;
}
.home-account { display: flex; align-items: center; flex-wrap: wrap; justify-content: space-between; gap: .8rem 1.25rem; padding: 1rem 1.2rem; }
.home-account h3, .home-account p { margin: .2rem 0; }
.home-account > div:first-child:not(.home-shortcuts) { flex: 1 1 330px; }
.home-account #home-linked { flex: 1 0 100%; min-width: 0; }
.home-shortcuts, .home-linked-list { display: flex; flex-wrap: wrap; gap: .45rem; }
.home-linked-list + .home-shortcuts { margin-top: .55rem; }
.home-linked-list a { display: flex; gap: .65rem; align-items: center; min-width: 0; background: var(--raised); border-radius: 8px; padding: .5rem .75rem; text-decoration: none; }
.home-linked-list img { width: 40px; height: 40px; object-fit: cover; border-radius: 50%; }
.home-linked-list small { display: block; color: var(--muted); }
.home-elements { display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); gap: .45rem; }
.home-elements button { min-height: 46px; padding: .4rem; gap: .35rem; }
.home-elements button[aria-pressed=true] { border-color: var(--accent); background: #37284b; color: #f1e7ff; }
.home-elements img { width: 23px; height: 23px; object-fit: contain; }
.home-characters { display: grid; grid-template-columns: repeat(6,minmax(0,1fr)); gap: .5rem; min-height: 104px; margin: .65rem 0; }
.home-characters a { display: grid; gap: .3rem; justify-items: center; text-align: center; align-content: center; min-height: 104px; padding: .45rem .25rem; border-radius: 9px; background: var(--surface); text-decoration: none; font-size: .83rem; }
.home-characters img { object-fit: cover; border-radius: 12px; }
.home-characters a:hover, .home-features > a:hover, .home-news-card:hover { background: var(--raised); }
.home-characters a, .home-features > a, .home-news-card { transition: background-color .18s ease; }
.home-features { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: .55rem; }
.home-features > a { display: block; padding: .85rem; text-decoration: none; }
.home-features svg { color: var(--accent); }
.home-features h3 { margin: .35rem 0; font-size: .97rem; }
.home-features p { margin: 0; font-size: .88rem; }
.home-news-card { display: block; padding: .9rem 1.1rem; text-decoration: none; }
.home-news-card h3, .home-news-card p { margin: .2rem 0; }
.home-news-meta { display: flex; flex-wrap: wrap; gap: .55rem; font-size: .85rem; }
.home-news-meta span { color: var(--accent); }
.home-announcement-list { display: grid; gap: .55rem; }
.announcement-body { white-space: pre-wrap; overflow-wrap: anywhere; }
#announcement-editor { max-height: 87dvh; overflow-y: auto; }
#announcement-admin-list { display: grid; gap: .55rem; }
.site-footer .footer-layout { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .7rem 1.2rem; }
.footer-brand, .footer-links { display: flex; align-items: center; flex-wrap: wrap; gap: .35rem .7rem; }
.footer-attribution { flex: 1 1 65%; margin: 0; }
@media (max-width: 768px) {
  .home-elements { grid-template-columns: repeat(4,minmax(0,1fr)); }
  .home-characters { grid-template-columns: repeat(3,minmax(0,1fr)); min-height: 214px; }
  .home-features { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .home-hero {
    --mobile-art-height: clamp(154px, 47vw, 280px);
    align-items:start;
    background:#15111d;
  }
  .home-hero-copy { padding-top:calc(var(--mobile-art-height) - 8px); }
  .home-landscape { inset:0 0 auto; height:var(--mobile-art-height); }
  .home-landscape img { object-position:72% 53%; }
  .home-hero::after { inset:0 0 auto; height:var(--mobile-art-height);
    background:linear-gradient(0deg,#15111d,transparent 58%);
  }
  .home-landscape-controls { top:10px; right:10px; bottom:auto; gap:0; }

}
@media (max-width: 460px) {
  .home-hero .hero-search { display: grid; grid-template-columns: minmax(0,1fr); gap: .4rem; }
  .home-elements button { font-size: .74rem; flex-direction: column; min-height: 59px; }
  .home-features > a:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .footer-links a { min-height: 44px; display: inline-flex; align-items: center; }
}
@media (prefers-reduced-motion: reduce) {
  .home-characters a,.home-features > a,.home-news-card { transition: none; }
}

/* Homepage editorial layout, separate from the original UID hero and announcements. */
.leyra-home { --home-line:#4c3b64; --home-ink:#f6eeff; --home-muted:#c6b7d5; }
.home-editorial-heading { margin: 0 0 clamp(.85rem,1.8vw,1.45rem); }
.home-eyebrow { color: #cdb3f3; font-size: .73rem; font-weight: 760; letter-spacing: .13em; text-transform: uppercase; margin: 0 0 .4rem; }
.home-editorial-heading h2, .home-directory-head h2, .home-account-lead h2 {
  margin: 0; color: var(--home-ink); line-height: 1.12; letter-spacing: -.025em;
}
.home-editorial-heading h2 { font-size: clamp(1.55rem,2.4vw,2.35rem); }
.home-entry-grid { display:grid; grid-template-columns:minmax(0,1.25fr) minmax(0,1fr); gap:clamp(.65rem,1.3vw,1.1rem); }
.home-featured-entry {
  isolation:isolate; display:grid; align-items:center; position:relative; overflow:hidden; min-width:0;
  min-height:clamp(240px,22vw,310px); padding:clamp(1.1rem,3vw,2.65rem); border:1px solid #6b5488;
  border-radius:17px; color:var(--home-ink); text-decoration:none;
  background:radial-gradient(ellipse at 87% 35%,#5a3d8180,transparent 58%),linear-gradient(110deg,#20162e 0%,#2b1d42 100%);
}
.home-featured-entry:hover { border-color:#c8a9ff; background-color:#352247; }
.home-orbit {
  position:absolute; z-index:-1; pointer-events:none; color:#d5b6ff; width: min(64%, 420px);
  height:auto; inset-inline-end:0; inset-block-start:50%; transform:translateY(-50%); opacity:.62;
}
.home-featured-copy { min-width:0; max-width:36ch; }
.home-featured-copy h3 { font-size:clamp(1.6rem,3vw,3rem); letter-spacing:-.043em; line-height:1.04; margin:.42rem 0 .62rem; }
.home-featured-copy p { margin:0; color:#ded3ec; max-width:31ch; line-height:1.45; }
.home-featured-cta { display:inline-flex; align-items:center; gap:.55rem; margin-top:1.05rem; padding:.46rem .72rem;
  border:1px solid #dcbeff74; border-radius:999px; background:#39245a; color:#f5eaff; font-size:.86rem; font-weight:700; }

.home-route-stack,.home-directory-items,.home-account-band ul { list-style:none; padding:0; margin:0; }
.home-route-stack { display:grid; grid-auto-rows:1fr; gap:.55rem; min-width:0; }
.home-row-link {
  --tile-accent:#d5b7f8;
  display:grid; grid-template-columns:auto minmax(0,1fr) auto; align-items:center;
  gap:clamp(.55rem,1.1vw,.85rem); min-width:0; min-height:100%; padding:clamp(.65rem,1.05vw,.98rem);
  border:1px solid #4d3b63; border-radius:12px; background:#20182c;
  text-decoration:none; color:#f6efff; transition:background-color .16s ease,border-color .16s ease;
}
.home-row-link:hover { border-color:var(--tile-accent); background:#2c2040; }
.home-accent-mint { --tile-accent:#9cdbc7; }
.home-accent-rose { --tile-accent:#f0b2d8; }
.home-accent-gold { --tile-accent:#f0cf99; }
.home-tile-icon {
  display:grid; place-items:center; width:2.4rem; aspect-ratio:1; color:var(--tile-accent,#d5b7f8);
  background:color-mix(in srgb,var(--tile-accent,#d5b7f8) 12%,#21182e);
  border:1px solid color-mix(in srgb,var(--tile-accent,#d5b7f8) 30%,#3c2a52); border-radius:9px;
}
.home-row-copy { display:grid; gap:.17rem; min-width:0; }
.home-row-copy > strong { color:#fff9ff; font-size:.95rem; }
.home-row-copy > span { color:var(--home-muted); font-size:.81rem; line-height:1.35; }
.home-row-arrow { color:var(--tile-accent); font-weight:730; }
.leyra-home :is(.home-featured-entry,.home-row-link,.home-text-link):focus-visible {
  outline:2px solid #d5b2ff; outline-offset:3px;
}
.home-directory-grid { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:clamp(.65rem,1.3vw,1.1rem); }
.home-directory,.home-account-band,.home-updates {
  border:1px solid var(--home-line); border-radius:16px; padding:clamp(.9rem,1.65vw,1.55rem); min-width:0; background:#171221;
}
.home-directory-database { background:radial-gradient(ellipse at 0% 0%,#3b2b5638,transparent 70%),#171221; }
.home-directory-progress { display:flex; flex-direction:column; background:radial-gradient(ellipse at 100% 0%,#36445a52,transparent 65%),#171221; }
.home-directory-head {
  display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:.5rem 1rem; margin-bottom:.75rem;
}
.home-directory-head h2, .home-account-lead h2 { font-size:clamp(1.28rem,2vw,1.75rem); margin:0; }
.home-directory-head .home-text-link { font-size:.85rem; white-space:nowrap; }
.home-directory-items { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:.45rem; }
.home-directory-database .home-directory-items { grid-template-columns:minmax(0,1fr); }
.home-directory-progress .home-directory-items { flex:1; }
.home-directory-items .home-row-link { padding:.48rem .6rem; }
.home-directory-items .home-tile-icon { width:2rem; }
.home-directory-items .home-tile-icon > svg { width:16px; height:16px; }
.home-directory-items .home-row-copy > strong { font-size:.86rem; }
.home-directory-items .home-row-copy > span { font-size:.74rem; }

.home-account-band { display:grid; grid-template-columns:minmax(150px,.8fr) minmax(0,4fr); gap:1rem; align-items:center; }
.home-account-band ul { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,190px),1fr)); gap:.6rem; }
.home-account-band li { display:grid; grid-template-columns:auto minmax(0,1fr); gap:.5rem; min-width:0; }
.home-account-band li .home-tile-icon { width:1.85rem; }
.home-account-band h3 { margin:.05rem 0 .22rem; color:#eee1fb; font-size:.87rem; }
.home-account-band li p { margin:0; color:var(--home-muted); font-size:.76rem; line-height:1.4; }
.home-updates #home-news .home-news-card { background:#21182c; border:1px solid #3c2d50; }
.home-updates #home-news a.home-news-card:hover { border-color:#9c77c2; }
/* Preserve live text metrics, but draw a narrow stripe within each line box
   so adjacent lines never merge into one tall loading shape. */
.skeleton-home .home-skeleton-text {
  color:transparent;
  background:linear-gradient(transparent 23%,#392d49 23% 77%,transparent 77%);
  -webkit-box-decoration-break:clone;
  box-decoration-break:clone;
}
.skeleton-home :is(.home-hero h1,.home-featured-copy h3) .home-skeleton-text {
  background:linear-gradient(transparent 27%,#403250 27% 73%,transparent 73%);
}
.skeleton-home .home-skeleton-art {
  background:radial-gradient(ellipse at 73% 41%,#5b45764f 0%,#34264948 39%,transparent 74%);
}
.skeleton-home .home-skeleton-controls {
  width:min(385px,45%); height:38px; min-height:0;
  background:#251b36; border-color:#61497854;
}
.skeleton-home .home-skeleton-wish::before {
  content:""; width:80%; height:86%; border-radius:50%;
  background:radial-gradient(ellipse,#ad86d025,transparent 71%);
}
.skeleton-home .home-featured-cta.home-skeleton-text {
  background:#392b49; border-color:#75589460;
}
.skeleton-home .home-skeleton-input { height: 46px; }
.skeleton-home .home-skeleton-search {
  width: auto;
  min-height: 46px;
  height: auto;
  color: transparent;
  background-color: #3b2b50;
  border-color: transparent;
}
.skeleton-home .home-tile-icon { height: auto; }
.skeleton-home .home-skeleton-arrow { width: 17px; height: 10px; }
@media (max-width:768px) {
  .skeleton-home .home-skeleton-controls { width:46px; height:46px; }
}
@media (max-width: 1130px) {
  .home-directory-progress .home-directory-items { grid-template-columns:minmax(0,1fr); }
}
@media (max-width: 740px) {
  .home-account-band { grid-template-columns:minmax(0,1fr); }
  .home-entry-grid { grid-template-columns:minmax(0,1fr); }
  .home-featured-entry { min-height:204px; }
  .home-orbit { opacity:.4; width:min(64%,320px); inset-inline-end:-1rem; }
}
@media (max-width: 580px) {
  .home-directory-grid { grid-template-columns:minmax(0,1fr); }
  .home-directory-items .home-row-link { min-height:52px; }
}
@media (prefers-reduced-motion: reduce) { .home-row-link { transition:none; } }

/* HoYoverse panoramas use individual focal points, especially when cropped on phones. */
.home-hero[data-artwork="official"] .home-landscape img { object-position:var(--landscape-focus,55%) 55%; }
.home-hero[data-artwork="official"] [data-landscape="liyue"] { --landscape-focus:61%; }
@media (max-width:768px) {
  .home-hero[data-artwork="official"] [data-landscape="inazuma"] { --landscape-focus:43%; }
}

@media (min-width:769px) {
  .home-hero[data-artwork="official"] .home-landscape { mask-image:linear-gradient(90deg, transparent, #000 16%); }
}

/* Keep the seven selectors reachable when the panorama is narrow. */
.home-scene-dots { display:flex; gap:.28rem; }
.home-hero[data-artwork="official"] [data-landscape="sumeru"] { --landscape-focus:56%; }
.home-hero[data-artwork="official"] [data-landscape="fontaine"] { --landscape-focus:53%; }
.home-hero[data-artwork="official"] [data-landscape="natlan"] { --landscape-focus:58%; }
.home-hero[data-artwork="official"] [data-landscape="snezhnaya"] { --landscape-focus:53%; }
@media (max-width:768px) {
  .home-hero :is(.home-landscape-location,.home-scene-dots) { display:none; }
  .home-hero .home-landscape-controls { padding:0; }
  .home-hero .home-scene-pause { min-width:44px; min-height:44px; }
  .home-hero .home-scene-pause svg { width:16px; height:16px; }
}

@media (min-width:769px) {
  .home-hero[data-artwork="official"] img[data-landscape="mondstadt"] { object-position:var(--landscape-focus,55%) 60%; }
  .home-hero[data-artwork="official"] img[data-landscape="liyue"] { object-position:var(--landscape-focus) 42%; }
  .home-hero[data-artwork="official"] img[data-landscape="sumeru"] { object-position:var(--landscape-focus) 12%; }
  .home-hero[data-artwork="official"] img[data-landscape="snezhnaya"] { object-position:var(--landscape-focus) 44%; }
}

/* Current Event Wish portraits sit in the existing orbit, behind no copy. */
.home-featured-tile { position:relative; min-width:0; display:grid; }
.home-featured-tile:has(.home-wish-art:not([hidden])) .home-featured-copy { max-width:min(36ch,59%); }
.home-featured-tile:has(.home-wish-art:not([hidden])) .home-orbit { opacity:.28; }
.home-wish-art {
  position:absolute; z-index:-1; inset:0 4% 0 auto; width:45%; pointer-events:none;
  display:grid; justify-items:center; align-content:center;
}
.home-wish-art[hidden],.home-wish-pause[hidden] { display:none; }
.home-wish-portraits {
  position:relative; width:min(82%,220px); aspect-ratio:1; isolation:isolate;
}
.home-wish-portraits::before {
  content:""; position:absolute; inset:1%; border-radius:50%;
  background:radial-gradient(circle,#d5a56754 0%,#8d64c83e 55%,transparent 73%);
}
.home-wish-portraits img {
  position:absolute; inset:0; width:100%; height:100%; object-fit:contain; opacity:0;
  filter:drop-shadow(0 8px 13px #130a1f88);
}
.home-wish-portraits img.is-current { opacity:1; }
.home-wish-crossfade .home-wish-portraits img {
  transition:opacity 1.15s ease-in-out;
}
.home-wish-pause {
  position:absolute; inset:auto .6rem .6rem auto; width:30px; height:30px; display:grid; place-items:center;
  border:1px solid #d5b6ff55; border-radius:50%; color:#f8eaff; background:#221634; font:inherit; font-size:.75rem;
  cursor:pointer;
}
.home-wish-pause:hover,.home-wish-pause:focus-visible { border-color:#e0c3ff; }
@media (max-width:740px) {
  .home-wish-art { inset-inline-end:2%; }
  .home-wish-portraits { width:min(88%,158px); }
  .home-featured-tile:has(.home-wish-art:not([hidden])) .home-featured-copy { max-width:56%; }
}
@media (prefers-reduced-motion:reduce) { .home-wish-crossfade .home-wish-portraits img { transition:none; } }


/* Match Leyra's image handling without disabling navigation or text selection. */
.leyra-home :is(.home-landscape img,.home-wish-portraits img) {
  -webkit-user-select:none; user-select:none;
  -webkit-user-drag:none; -webkit-touch-callout:none;
}
.home-wish-portraits img.is-current { pointer-events:auto; }

@media (min-width:1250px) {
  /* Center the portrait in the marked space instead of over the orbit. */
  .home-wish-art { inset-inline-end:25.5%; }
  .home-featured-tile:has(.home-wish-art:not([hidden])) .home-featured-copy { max-width:min(36ch,29%); }
}

@media (min-width:741px) and (max-width:1249px) {
  .home-featured-tile:has(.home-wish-art:not([hidden])) .home-featured-copy { max-width:min(36ch,53%); }
}

/* Official character-site cutouts are larger than the fallback banner portraits. */
.home-wish-art:has(img[data-official]) { align-content:stretch; }
.home-wish-portraits:has(img[data-official]) { width:100%; min-height:0; aspect-ratio:auto; }
.home-wish-portraits:has(img[data-official]) img:not([data-official]) {
  width:min(82%,220px); height:auto; inset:50% auto auto 50%; translate:-50% -50%;
}
.home-wish-portraits img[data-official] {
  object-fit:cover; object-position:var(--wish-focus) 0%; top:5%; height:95%;
  filter:none;
}
.home-wish-portraits img[data-official="zibai"] { --wish-focus:40%; }
.home-wish-portraits img[data-official="linnea"] { --wish-focus:57%; }
@media (max-width:740px) {
  .home-wish-portraits img[data-official] { top:15%; height:85%; }
}

/* Use each cutout's own aspect ratio instead of clipping it to a fixed portrait width. */
.home-wish-portraits:has(img[data-official])::before { content:none; }
@media (min-width:769px) {
  .home-wish-portraits img[data-official] {
    width:auto; max-width:none; height:95%; left:50%; right:auto; bottom:0;
    object-fit:contain; translate:var(--wish-anchor) 0;
  }
  .home-wish-portraits img[data-official="zibai"] { --wish-anchor:-40%; }
  .home-wish-portraits img[data-official="linnea"] { --wish-anchor:-57%; }
}

@media (min-width:769px) and (max-width:1249px) {
  .home-wish-art:has(img[data-official]) { inset-inline-end:1%; }
}
@media (min-width:1250px) {
  .home-wish-art:has(img[data-official]) { inset-inline-end:14%; }
}
