/* ELIE 5.1.83: professional archive consistency, expanded lore and 100-pilot relay */

/* Archive detail focus: remove unrelated career and share controls. */
html.archive-detail-open .top-actions-dock > [data-career],
html.archive-detail-open .top-actions-dock > .career,
html.archive-detail-open .top-actions-dock > .home-share-launch{
  opacity:0!important;
  visibility:hidden!important;
  pointer-events:none!important;
}

/* Locked archive signal: always large and exactly centered. */
#toast.locked-toast{
  left:50%!important;
  top:50%!important;
  bottom:auto!important;
  z-index:30000!important;
  width:auto!important;
  min-width:min(72vw,560px)!important;
  max-width:86vw!important;
  padding:clamp(22px,3.1vh,42px) clamp(34px,4.5vw,78px)!important;
  border:2px solid #2ef13a!important;
  border-radius:0!important;
  background:rgba(0,8,2,.97)!important;
  box-shadow:0 0 0 1px rgba(46,241,58,.16) inset,0 0 42px rgba(46,241,58,.12)!important;
  color:#2ef13a!important;
  font-size:clamp(34px,5.3vw,86px)!important;
  font-weight:800!important;
  line-height:.95!important;
  letter-spacing:.12em!important;
  text-align:center!important;
  white-space:normal!important;
  transform:translate(-50%,-50%) scale(.94)!important;
}
#toast.locked-toast.show{transform:translate(-50%,-50%) scale(1)!important}
#toast.locked-toast::before,
#toast.locked-toast::after{content:"";position:absolute;width:18px;height:18px;border-color:#2ef13a;opacity:.85}
#toast.locked-toast::before{left:8px;top:8px;border-left:2px solid;border-top:2px solid}
#toast.locked-toast::after{right:8px;bottom:8px;border-right:2px solid;border-bottom:2px solid}

/* One close language everywhere: exact MYRA signal control. */
:is(.myra-close,.close-btn,.career-close,.player-stats-close,.planet-detail-close,
.upgrade-close,.upgrade-detail-close,.pilot-passport-close,.universe-modal-close,
.update-center-close,.artwork-gallery-close,.game-art-gallery-close,.mobile-menu-close,
.badge-window-close,.badge-unlock-close,.kadim-stone-close){
  width:48px!important;
  height:48px!important;
  min-width:48px!important;
  min-height:48px!important;
  padding:0!important;
  border:0!important;
  border-radius:0!important;
  background-color:transparent!important;
  background-image:url('../assets/images/Close-Off.png')!important;
  background-position:center!important;
  background-repeat:no-repeat!important;
  background-size:contain!important;
  box-shadow:none!important;
  color:transparent!important;
  font-size:0!important;
  line-height:0!important;
  cursor:pointer!important;
}
:is(.myra-close,.close-btn,.career-close,.player-stats-close,.planet-detail-close,
.upgrade-close,.upgrade-detail-close,.pilot-passport-close,.universe-modal-close,
.update-center-close,.artwork-gallery-close,.game-art-gallery-close,.mobile-menu-close,
.badge-window-close,.badge-unlock-close,.kadim-stone-close):hover,
:is(.myra-close,.close-btn,.career-close,.player-stats-close,.planet-detail-close,
.upgrade-close,.upgrade-detail-close,.pilot-passport-close,.universe-modal-close,
.update-center-close,.artwork-gallery-close,.game-art-gallery-close,.mobile-menu-close,
.badge-window-close,.badge-unlock-close,.kadim-stone-close):focus-visible{
  background-color:transparent!important;
  background-image:url('../assets/images/Close-On.png')!important;
  color:transparent!important;
  box-shadow:none!important;
}

.close-btn:hover,.close-btn:focus-visible,
.badge-window-close:hover,.badge-window-close:focus-visible,
.kadim-stone-close:hover,.kadim-stone-close:focus-visible{transform:none!important}
.badge-unlock-close:hover,.badge-unlock-close:focus-visible{transform:translate(48%,-48%)!important}

:is(.myra-close,.close-btn,.career-close,.player-stats-close,.planet-detail-close,
.upgrade-close,.upgrade-detail-close,.pilot-passport-close,.universe-modal-close,
.update-center-close,.artwork-gallery-close,.game-art-gallery-close,.mobile-menu-close,
.badge-window-close,.badge-unlock-close,.kadim-stone-close)>*{
  opacity:0!important;
  visibility:hidden!important;
  pointer-events:none!important;
}

/* Kadim Stone: image at left, publication copy directly beside it, no center signal graph. */
.kadim-stone-window .kadim-stone-header.signal-archive-heading{
  display:grid!important;
  grid-template-columns:clamp(74px,6.2vw,118px) minmax(0,1fr)!important;
  align-items:center!important;
  justify-content:start!important;
  gap:clamp(16px,1.6vw,30px)!important;
  left:4.2%!important;
  right:8%!important;
  top:4.2%!important;
  min-height:120px!important;
  padding:0 0 18px!important;
  text-align:left!important;
}
.kadim-stone-window .kadim-stone-header::after,
.kadim-stone-window .signal-archive-heading-wave{display:none!important}
.kadim-stone-header-icon{
  display:block!important;
  width:100%!important;
  max-height:104px!important;
  object-fit:contain!important;
  filter:none!important;
  justify-self:start!important;
}
.kadim-stone-window .kadim-stone-header .signal-archive-heading-copy{
  width:100%!important;
  min-width:0!important;
  text-align:left!important;
}
.kadim-stone-window .kadim-stone-header :is(small,h2,p){text-align:left!important}
.kadim-stone-window .kadim-stone-list-frame{top:24%!important}
html[dir="rtl"] .kadim-stone-window .kadim-stone-header.signal-archive-heading{
  direction:rtl!important;
  grid-template-columns:minmax(0,1fr) clamp(74px,6.2vw,118px)!important;
}
html[dir="rtl"] .kadim-stone-window .kadim-stone-header-icon{grid-column:2}
html[dir="rtl"] .kadim-stone-window .kadim-stone-header .signal-archive-heading-copy{grid-column:1;grid-row:1}
html[dir="rtl"] .kadim-stone-window .kadim-stone-header :is(small,h2,p){text-align:right!important}

/* Book: clear left visual station and lower right reading column. */
.book-screen .book-art{
  display:block!important;
  left:6.5%!important;
  top:30%!important;
  bottom:auto!important;
  width:clamp(170px,18vw,330px)!important;
  max-height:56%!important;
  object-fit:contain!important;
  z-index:3!important;
}
.book-screen .book-download-signal{
  left:27.5%!important;
  right:auto!important;
  top:52%!important;
  bottom:auto!important;
  width:clamp(148px,12.8vw,230px)!important;
  height:clamp(46px,4.1vw,68px)!important;
  transform:none!important;
  z-index:4!important;
}
.book-screen .book-download-signal:hover,
.book-screen .book-download-signal:focus-visible{transform:scale(1.012)!important}
.book-screen .book-copy.book-copy-v5182{
  left:47.5%!important;
  right:4.5%!important;
  top:20%!important;
  bottom:7%!important;
  width:auto!important;
  max-width:none!important;
  z-index:3!important;
}
.book-screen .book-scroll-frame{padding-top:clamp(26px,3.2vh,46px)!important}

/* How to Play: visual controls own a protected column and never enter copy. */
.how-command-controls .how-control-deck{gap:clamp(14px,1.3vw,24px)!important}
.how-command-controls .how-control-card{
  grid-template-columns:minmax(190px,36%) minmax(0,1fr)!important;
  align-items:center!important;
  gap:clamp(18px,1.5vw,30px)!important;
  padding:clamp(18px,1.5vw,28px)!important;
  overflow:hidden!important;
}
.how-command-controls .how-control-symbol{
  width:100%!important;
  height:auto!important;
  min-height:150px!important;
  max-width:100%!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  flex-wrap:nowrap!important;
  gap:clamp(10px,1vw,18px)!important;
  padding:8px!important;
  box-sizing:border-box!important;
  overflow:hidden!important;
}
.how-command-controls .how-control-copy{min-width:0!important;padding-left:2px!important}
.how-command-controls .how-touch-controller{
  flex:0 1 auto!important;
  width:clamp(92px,7.8vw,136px)!important;
  max-width:52%!important;
  max-height:132px!important;
  object-fit:contain!important;
}
.how-command-controls .how-mobile-action-stack{
  flex:0 0 auto!important;
  max-width:46%!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  gap:clamp(6px,.6vw,10px)!important;
}
.how-command-controls .how-arrow-pad{flex:0 0 auto!important}
.how-command-controls .how-control-key-stack{flex:0 0 auto!important}

/* Objects gain presence without touching frame or labels. */
.species-card.archive-card-with-world .object-card-img{
  top:calc(var(--u)*4.05)!important;
  left:1%!important;
  width:98%!important;
  height:calc(var(--u)*17.05)!important;
  object-fit:contain!important;
  transform:scale(1.06)!important;
  transform-origin:center center!important;
}
.object-detail .object-detail-image{
  left:-6%!important;
  top:-6%!important;
  width:112%!important;
  height:112%!important;
  object-fit:contain!important;
}

/* 100 pilots remain fluid in the existing two-column relay. */
.score-pair-scroll{overscroll-behavior:contain;scrollbar-gutter:stable}
.score-pair-row{content-visibility:auto;contain-intrinsic-size:0 72px}

@media (orientation:landscape) and (pointer:coarse), (max-height:760px){
  #toast.locked-toast{min-width:min(66vw,470px)!important;padding:14px 28px!important;font-size:clamp(24px,7vh,46px)!important}
  :is(.myra-close,.close-btn,.career-close,.player-stats-close,.planet-detail-close,
  .upgrade-close,.upgrade-detail-close,.pilot-passport-close,.universe-modal-close,
  .update-center-close,.artwork-gallery-close,.game-art-gallery-close,.mobile-menu-close,
  .badge-window-close,.badge-unlock-close,.kadim-stone-close){width:34px!important;height:34px!important;min-width:34px!important;min-height:34px!important}
  .badge-unlock-close:hover,.badge-unlock-close:focus-visible{transform:translate(48%,0)!important}
  .kadim-stone-window .kadim-stone-header.signal-archive-heading{
    grid-template-columns:clamp(48px,11vh,72px) minmax(0,1fr)!important;
    gap:10px!important;left:15px!important;right:48px!important;top:9px!important;min-height:72px!important;padding:0 0 8px!important;
  }
  .kadim-stone-header-icon{max-height:62px!important}
  .kadim-stone-window .kadim-stone-list-frame{top:101px!important}
  html[dir="rtl"] .kadim-stone-window .kadim-stone-header.signal-archive-heading{grid-template-columns:minmax(0,1fr) clamp(48px,11vh,72px)!important;left:48px!important;right:15px!important}
  .book-screen .book-art{left:2.5%!important;top:27%!important;width:clamp(95px,18vw,170px)!important;max-height:57%!important}
  .book-screen .book-download-signal{left:21.5%!important;top:51%!important;width:clamp(105px,15vw,150px)!important;height:clamp(34px,7vh,46px)!important}
  .book-screen .book-copy.book-copy-v5182{left:39%!important;right:2.5%!important;top:17%!important;bottom:5%!important}
  .book-screen .book-scroll-frame{padding-top:15px!important}
  .how-command-controls .how-control-card{grid-template-columns:minmax(128px,34%) minmax(0,1fr)!important;gap:12px!important;padding:12px!important}
  .how-command-controls .how-control-symbol{min-height:105px!important;gap:6px!important;padding:4px!important}
  .how-command-controls .how-touch-controller{width:78px!important;max-height:82px!important}
  .how-command-controls .how-laser-mini{width:46px!important;height:46px!important}
  .how-command-controls .how-bomb-mini{width:40px!important;height:48px!important}
  .species-card.archive-card-with-world .object-card-img{top:clamp(48px,9.5vh,66px)!important;height:calc(100% - clamp(68px,13.5vh,92px))!important;transform:scale(1.08)!important}
  .object-detail .object-detail-image{left:-7%!important;top:-7%!important;width:114%!important;height:114%!important}
}

@media (max-width:680px) and (orientation:portrait){
  .badge-unlock-close:hover,.badge-unlock-close:focus-visible{transform:translate(20%,-42%)!important}
  #toast.locked-toast{min-width:82vw!important;padding:24px 20px!important;font-size:clamp(30px,11vw,54px)!important}
  :is(.myra-close,.close-btn,.career-close,.player-stats-close,.planet-detail-close,
  .upgrade-close,.upgrade-detail-close,.pilot-passport-close,.universe-modal-close,
  .update-center-close,.artwork-gallery-close,.game-art-gallery-close,.mobile-menu-close,
  .badge-window-close,.badge-unlock-close,.kadim-stone-close){width:40px!important;height:40px!important;min-width:40px!important;min-height:40px!important}
  .kadim-stone-window .kadim-stone-header.signal-archive-heading{
    grid-template-columns:58px minmax(0,1fr)!important;gap:12px!important;left:5%!important;right:58px!important;top:2.5%!important;min-height:92px!important;padding-bottom:10px!important;
  }
  .kadim-stone-header-icon{max-height:58px!important}
  .kadim-stone-window .kadim-stone-list-frame{top:16.5%!important}
  html[dir="rtl"] .kadim-stone-window .kadim-stone-header.signal-archive-heading{grid-template-columns:minmax(0,1fr) 58px!important;left:58px!important;right:5%!important}
  .book-screen .book-art{display:block!important;left:6%!important;top:13%!important;width:31vw!important;max-height:24%!important}
  .book-screen .book-download-signal{left:42%!important;right:5%!important;top:21%!important;width:auto!important;height:48px!important}
  .book-screen .book-copy.book-copy-v5182{left:5%!important;right:5%!important;top:40%!important;bottom:5%!important}
  .book-screen .book-scroll-frame{padding-top:18px!important}
  .how-command-controls .how-control-card{grid-template-columns:1fr!important;gap:8px!important}
  .how-command-controls .how-control-symbol{min-height:116px!important;max-height:132px!important}
  .how-command-controls .how-control-copy{text-align:left!important}
  html[dir="rtl"] .how-command-controls .how-control-copy{text-align:right!important}
  .species-card.archive-card-with-world .object-card-img{transform:scale(1.06)!important}
}

@media (prefers-reduced-motion:reduce){
  html.archive-detail-open .top-actions-dock > [data-career],
  html.archive-detail-open .top-actions-dock > .career,
  html.archive-detail-open .top-actions-dock > .home-share-launch{transition:none!important}
}
