/* Asteria home & header: preserve existing crystal buttons, colour tokens and gameplay. */
:root {
  --core-header-height: clamp(76px, 6.55vw, 160px);
}
body .topbar.asteria-header {
  height:var(--core-header-height)!important;
  min-height:var(--core-header-height)!important;
  padding:0 0 0 clamp(12px,1.5vw,24px)!important;
  gap:clamp(6px,.9vw,18px)!important;
  align-items:center!important;
}
body .asteria-header .asteria-header-brand {
  flex:0 1 clamp(225px,31vw,510px)!important;
  width:clamp(225px,31vw,510px)!important;
  max-height:calc(var(--core-header-height) - 3px)!important;
  overflow:hidden;
}
body .asteria-header .asteria-header-wordmark {
  max-height:calc(var(--core-header-height) - 3px);
  width:100%;height:100%;
}
body .asteria-header .top-actions {
  align-self:stretch!important;
  gap:clamp(5px,.6vw,10px)!important;
  margin-right:0!important;
}
body .asteria-header #globalNavigation { min-width:0!important; }
body .asteria-header #accountControls {order:0; flex:0 0 auto;}
body .asteria-header #settingsToggle {order:1;}
body .asteria-header .asteria-header-profile {
  order:2;
  display:flex;
  position:relative;
  align-items:stretch;
  justify-content:stretch;
  flex:0 0 var(--core-header-height)!important;
  width:var(--core-header-height)!important;
  max-width:var(--core-header-height)!important;
  height:var(--core-header-height)!important;
  min-height:var(--core-header-height)!important;
  border-radius:0!important;
  overflow:hidden!important;
  -webkit-mask-image:none!important;
  mask-image:none!important;
  isolation:isolate;
  background:#0c1b29;
}
body .asteria-header .asteria-header-profile[hidden] {display:none!important;}
body .asteria-header #asteriaHeaderAvatarButton {
  position:absolute;inset:0;
  width:100%!important;height:100%!important;
  min-width:100%!important;min-height:100%!important;
  border:0!important;border-radius:0!important;padding:0!important;
  background:linear-gradient(155deg,#314960,#07111b)!important;
  display:grid;place-items:center;
  font-size:clamp(1.8rem,3vw,3.7rem);
  overflow:hidden;
}
body .asteria-header #asteriaHeaderAvatarButton img {
  width:100%!important;height:100%!important;
  position:absolute;inset:0;
  object-fit:cover!important;
  -webkit-mask-image:linear-gradient(to right, transparent 0%,rgba(0,0,0,.38) 12%,#000 31%,#000 96%,rgba(0,0,0,.75) 100%);
  mask-image:linear-gradient(to right, transparent 0%,rgba(0,0,0,.38) 12%,#000 31%,#000 96%,rgba(0,0,0,.75) 100%);
}
body .asteria-header #asteriaHeaderAvatarFallback {grid-area:1/1;}
body .asteria-header .asteria-header-identity {
  position:absolute;bottom:0;left:0;right:0;
  padding:clamp(14px,1.7vw,28px) 7px 6px;
  z-index:2;
  pointer-events:none;
  display:flex;flex-direction:column;align-items:center;gap:1px;
  background:linear-gradient(180deg,transparent 0%,rgba(0,0,0,.85) 70%);
}
body .asteria-header #asteriaHeaderName {
  color:#fff;font-size:clamp(.63rem,.78vw,.86rem);line-height:1.15;
  font-weight:750;max-width:100%;text-shadow:0 1px 4px black;
}
body .asteria-header #asteriaHeaderAccountId {
  color:#d9e7f4;font-size:clamp(.54rem,.69vw,.72rem);
  line-height:1.15;max-width:100%;text-shadow:0 1px 4px black;
}
body .asteria-header .asteria-header-mail {
  position:absolute;right:4px;top:3px;z-index:3;
  font-size:1.15rem;
  filter:drop-shadow(0 1px 2px black);
}
body .asteria-header .crystal-button,
body .asteria-header #accountControls .crystal-button {
  min-height:40px!important;
  padding:8px 14px!important;
}
body .asteria-header #settingsToggle {
  margin-right:4px!important;
}
.asteria-profile-username-note {
  margin:0;color:#bdcfda;font-size:.82rem;line-height:1.5;
}
#home.asteria-home-refreshed {
  position:relative;
  isolation:isolate;
  display:block;
  min-height:max(84vh,670px);
  padding:0 0 96px!important;
  overflow:hidden;
  background:transparent!important;
  border:0!important;
}
#home.asteria-home-refreshed:not(.show) {display:none!important;}
body .main:has(> #home.asteria-home-refreshed.show) {
  padding:0!important;
  background:transparent!important;
}
#home .asteria-home-cinematic {
  position:relative;
  width:100%;
  height:clamp(430px,58vh,830px);
  overflow:hidden;
  isolation:isolate;
  background:transparent;
  /* Keep the illustration fully clear across its centre; only the bottom 9% fades. */
  -webkit-mask-image:linear-gradient(to bottom,#000 0%,#000 91%,transparent 100%);
  mask-image:linear-gradient(to bottom,#000 0%,#000 91%,transparent 100%);
}
#home .asteria-home-cinematic::before {
  content:"";
  position:absolute;inset:0;z-index:1;pointer-events:none;
  /* Emphasise the left-edge dissolve; do not veil or soften the centre. */
  background:linear-gradient(to right,var(--asteria-site-background,#000) 0%,transparent 17%,transparent 95%,var(--asteria-site-background,#000) 100%),
    linear-gradient(to bottom,var(--asteria-site-background,#000) 0%,transparent 3%,transparent 94%,var(--asteria-site-background,#000) 100%);
}
#home .asteria-home-cinematic-art {
  display:block;width:100%;max-width:1920px;height:100%;
  margin-inline:auto;
  object-fit:cover;object-position:center 41%;
  /* Keep the image crisp on ultrawide screens; dissolve the image's own edges. */
  -webkit-mask-image:linear-gradient(to right,transparent 0%,#000 13%,#000 96%,transparent 100%);
  mask-image:linear-gradient(to right,transparent 0%,#000 13%,#000 96%,transparent 100%);
  filter:none;
  image-rendering:auto;
}
#home .asteria-home-introduction {
  position:relative;
  z-index:2;
  width:min(960px,calc(100% - 42px));
  margin:-20px auto 0;
  display:flex;flex-direction:column;align-items:center;
  text-align:center;gap:10px;
  color:var(--text,#eee);
  text-shadow:0 2px 9px rgba(0,0,0,.86);
}
#home .asteria-home-introduction h2 {
  margin:0;
  font-size:clamp(2.2rem,5vw,4.2rem);
}
#home .asteria-home-introduction p {margin:0;}
#home .asteria-home-introduction .hero-actions {
  display:flex;justify-content:center;flex-wrap:wrap;gap:12px;
  margin-top:16px;
}
@media (max-width:1679px) {
  :root {--core-header-height:clamp(68px,6.55vw,112px)!important;}
  body .asteria-header .asteria-header-brand {
    flex:0 1 clamp(172px,28vw,380px)!important;
    width:clamp(172px,28vw,380px)!important;
  }
}
@media (max-width:720px) {
  :root {--core-header-height:58px!important;}
  body .topbar.asteria-header {padding:0 0 0 7px!important;gap:4px!important;}
  body .asteria-header .asteria-header-brand {
    flex:0 1 166px!important;width:166px!important;
  }
  body .asteria-header #loginToggle {min-width:60px!important;padding:6px 7px!important;}
  body .asteria-header #settingsToggle {min-width:38px!important;width:38px!important;margin-right:0!important;}
  body .asteria-header .asteria-header-identity {padding:17px 2px 4px;}
  body .asteria-header #asteriaHeaderName {font-size:.56rem;}
  body .asteria-header #asteriaHeaderAccountId {font-size:.48rem;}
  #home .asteria-home-cinematic {height:clamp(325px,52vh,560px);}
  #home .asteria-home-introduction {margin:-14px auto 0;}
}
@media (max-width:380px) {
  :root {--core-header-height:54px!important;}
  body .asteria-header .asteria-header-brand {flex-basis:132px!important;width:132px!important;}
  body .asteria-header .asteria-header-identity {padding:16px 1px 2px;}
}
@media (prefers-reduced-motion:reduce) {
  body .asteria-header .asteria-header-profile.asteria-header-arriving {animation:none!important;}
}
