/* Nerddi OS Run 49.3 — Library + Spotlight Showcase
   Final spacing/presentation owner for Home spotlight and Library. */
:root{
  --r493-content:1680px;
  --r493-safe-x:max(clamp(18px,4vw,68px),env(safe-area-inset-left));
  --r493-gap:clamp(16px,1.55vw,26px);
  --r493-line:rgba(150,224,255,.11);
  --r493-panel:linear-gradient(155deg,rgba(9,18,30,.94),rgba(3,8,14,.985));
}

/* HOME SPOTLIGHT — ambient rings can feel oversized, but the hero itself owns a hard clip
   boundary and the game mark stays well inside its safe region. */
body[data-os-page="home"] .console-home-hero{
  position:relative;
  min-width:0;
  max-width:100%;
  overflow:clip!important;
  isolation:isolate;
  border:1px solid rgba(150,224,255,.075);
  border-radius:clamp(22px,2vw,30px);
  background:
    radial-gradient(circle at 76% 46%,color-mix(in srgb,var(--console-accent,#63f3ff) 12%,transparent),transparent 30%),
    linear-gradient(145deg,rgba(7,15,25,.84),rgba(3,8,14,.96))!important;
}
body[data-os-page="home"] .console-home-hero:after{
  content:"";
  position:absolute;
  z-index:0;
  width:min(50vw,760px);
  aspect-ratio:1;
  right:clamp(-190px,-8vw,-74px);
  top:50%;
  translate:0 -50%;
  border-radius:50%;
  border:1px solid color-mix(in srgb,var(--console-accent,#63f3ff) 20%,transparent);
  box-shadow:
    0 0 0 72px color-mix(in srgb,var(--console-accent,#63f3ff) 2.5%,transparent),
    0 0 130px color-mix(in srgb,var(--console-accent,#63f3ff) 10%,transparent);
  pointer-events:none;
}
body[data-os-page="home"] .console-hero-copy{position:relative;z-index:3!important;min-width:0;}
body[data-os-page="home"] .spotlight-art-stage{
  position:relative!important;
  z-index:2!important;
  width:100%;
  max-width:620px;
  min-width:0;
  min-height:clamp(300px,34vw,510px);
  display:grid!important;
  place-items:center;
  justify-self:center;
  overflow:visible;
}
body[data-os-page="home"] .spotlight-art-stage:before,
body[data-os-page="home"] .spotlight-art-stage:after{pointer-events:none;opacity:.72;}
body[data-os-page="home"] .spotlight-art-stage img{
  position:relative;
  z-index:2;
  display:block;
  width:auto!important;
  height:auto!important;
  max-width:78%!important;
  max-height:74%!important;
  object-fit:contain!important;
  object-position:center!important;
  transform:none!important;
  filter:drop-shadow(0 24px 44px rgba(0,0,0,.66)) drop-shadow(0 0 42px color-mix(in srgb,var(--console-accent,#63f3ff) 20%,transparent))!important;
}
body[data-os-page="home"] .console-home-hero.is-switching .spotlight-art-stage img{
  animation:r493SpotlightSwitch .3s cubic-bezier(.2,.78,.2,1) both;
}
body[data-os-page="home"] .console-home-hero.is-switching .console-hero-copy h1,
body[data-os-page="home"] .console-home-hero.is-switching .console-hero-copy p{
  animation:r493CopySwitch .26s ease both;
}
@keyframes r493SpotlightSwitch{
  0%{opacity:.2;transform:translateY(8px) scale(.975)!important;filter:blur(6px)}
  58%{opacity:1;filter:blur(0)}
  100%{opacity:1;transform:none!important}
}
@keyframes r493CopySwitch{0%{opacity:.52;transform:translateY(4px)}100%{opacity:1;transform:none}}

/* LIBRARY — one spacing owner, deterministic console gallery. */
body[data-os-page="library"]{overflow-x:hidden!important;}
body[data-os-page="library"] .console-shell{
  width:100%!important;
  max-width:none!important;
  overflow:visible!important;
}
body[data-os-page="library"] .console-page{
  box-sizing:border-box;
  display:block!important;
  width:100%!important;
  max-width:var(--r493-content)!important;
  height:auto!important;
  max-height:none!important;
  min-height:calc(100dvh - 64px)!important;
  margin:0 auto!important;
  padding:clamp(30px,4.3vw,68px) var(--r493-safe-x) clamp(64px,7vw,104px)!important;
  overflow:visible!important;
}
body[data-os-page="library"] .library-showcase-hero{
  width:100%;
  min-height:0!important;
  height:auto!important;
  display:grid!important;
  grid-template-columns:minmax(0,1fr) auto!important;
  align-items:end!important;
  gap:clamp(24px,4vw,64px)!important;
  margin:0!important;
  padding:clamp(26px,3vw,48px) 0 clamp(26px,3vw,46px)!important;
  border-bottom:1px solid rgba(150,224,255,.1)!important;
  overflow:visible!important;
}
body[data-os-page="library"] .library-showcase-hero h1{
  font-size:clamp(48px,6vw,88px)!important;
  line-height:.86!important;
  letter-spacing:-.055em!important;
  margin:12px 0 14px!important;
}
body[data-os-page="library"] .library-showcase-hero p{
  max-width:700px!important;
  margin:0!important;
  color:#7891a2!important;
  font-size:clamp(11px,.9vw,14px)!important;
  line-height:1.62!important;
}
body[data-os-page="library"] .library-showcase-hero .page-hero-stat{
  width:clamp(132px,12vw,180px)!important;
  height:clamp(132px,12vw,180px)!important;
  margin:0!important;
}
body[data-os-page="library"] .library-showcase-hero .page-hero-stat strong{font-size:clamp(42px,4.5vw,62px)!important;}

.library-filter-bar{
  position:sticky;
  top:clamp(56px,5.6dvh,68px);
  z-index:18;
  display:flex;
  align-items:center;
  gap:8px;
  min-width:0;
  padding:14px 0 12px;
  background:linear-gradient(180deg,rgba(2,6,10,.98),rgba(2,6,10,.91) 78%,transparent);
  backdrop-filter:blur(14px);
}
.library-filter-bar button{
  min-height:38px;
  border:1px solid rgba(150,224,255,.105);
  border-radius:999px;
  background:rgba(255,255,255,.018);
  color:#6f899a;
  padding:0 14px;
  font:900 clamp(8px,.63vw,10px)/1 system-ui,sans-serif;
  letter-spacing:.12em;
  white-space:nowrap;
  cursor:pointer;
  transition:border-color .16s ease,background .16s ease,color .16s ease,transform .16s ease;
}
.library-filter-bar button:hover,
.library-filter-bar button:focus-visible,
.library-filter-bar button[aria-pressed="true"]{
  outline:none;
  color:#dcfbff;
  border-color:rgba(99,243,255,.38);
  background:rgba(99,243,255,.075);
  box-shadow:inset 0 0 20px rgba(99,243,255,.035);
}
.library-filter-bar button:active{transform:translateY(1px)}
.library-filter-count{margin-left:auto;color:#617b8e;font-size:clamp(8px,.62vw,10px);font-weight:850;letter-spacing:.12em;white-space:nowrap;}

body[data-os-page="library"] .library-full{
  display:grid!important;
  grid-template-columns:repeat(3,minmax(0,1fr))!important;
  grid-auto-flow:row!important;
  grid-template-rows:none!important;
  grid-auto-columns:auto!important;
  align-items:stretch;
  width:100%!important;
  max-width:100%!important;
  min-width:0;
  height:auto!important;
  min-height:0!important;
  gap:var(--r493-gap)!important;
  padding:clamp(10px,1vw,18px) 0 0!important;
  overflow:visible!important;
  scroll-snap-type:none!important;
}
body[data-os-page="library"] .library-console-card{
  display:flex!important;
  flex-direction:column!important;
  width:100%!important;
  max-width:100%!important;
  min-width:0!important;
  min-height:0!important;
  height:auto!important;
  overflow:hidden!important;
  border:1px solid var(--r493-line)!important;
  border-radius:clamp(20px,1.6vw,26px)!important;
  background:var(--r493-panel)!important;
  box-shadow:0 18px 48px rgba(0,0,0,.22)!important;
  contain:layout paint;
}
body[data-os-page="library"] .library-console-card.is-library-hidden{display:none!important;}
body[data-os-page="library"] .library-console-art{
  flex:0 0 auto;
  width:100%!important;
  height:auto!important;
  min-height:0!important;
  aspect-ratio:16/9!important;
}
body[data-os-page="library"] .library-console-copy{
  display:flex!important;
  flex:1;
  flex-direction:column;
  min-width:0;
  overflow:visible!important;
  padding:clamp(18px,1.7vw,25px)!important;
}
body[data-os-page="library"] .library-console-copy>small{
  color:var(--tile-accent,#63f3ff)!important;
  font-size:clamp(7px,.58vw,9px)!important;
  line-height:1.25;
  letter-spacing:.13em!important;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
body[data-os-page="library"] .library-console-copy h2{
  margin:8px 0!important;
  color:#eefaff;
  font-size:clamp(24px,2vw,32px)!important;
  line-height:1!important;
  letter-spacing:-.035em;
  overflow-wrap:anywhere;
}
body[data-os-page="library"] .library-console-copy p{
  display:-webkit-box!important;
  -webkit-box-orient:vertical;
  -webkit-line-clamp:3;
  overflow:hidden!important;
  min-height:4.35em;
  margin:0 0 14px!important;
  color:#718a9b!important;
  font-size:clamp(10px,.78vw,12px)!important;
  line-height:1.45!important;
}
body[data-os-page="library"] .compact-chips{
  display:flex!important;
  flex-wrap:wrap;
  gap:6px;
  max-height:none!important;
  margin-top:auto;
  overflow:visible!important;
}
body[data-os-page="library"] .compact-chips span{
  max-width:100%;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  border-color:rgba(150,224,255,.105)!important;
  background:rgba(255,255,255,.022)!important;
  color:#6f899a!important;
  font-size:clamp(7px,.54vw,8px)!important;
}
body[data-os-page="library"] .library-console-copy footer{
  display:flex!important;
  align-items:center;
  justify-content:space-between;
  gap:12px!important;
  flex-wrap:wrap!important;
  margin-top:16px!important;
  padding-top:13px!important;
  border-top:1px solid rgba(150,224,255,.075)!important;
  font-size:clamp(7px,.56vw,9px)!important;
}
body[data-os-page="library"] .library-console-card:hover,
body[data-os-page="library"] .library-console-card:focus-visible,
body[data-os-page="library"] .library-console-card.os-focused{
  transform:translateY(-3px)!important;
  border-color:color-mix(in srgb,var(--tile-accent,#63f3ff) 48%,rgba(255,255,255,.12))!important;
  box-shadow:0 24px 58px rgba(0,0,0,.31),0 0 34px color-mix(in srgb,var(--tile-accent,#63f3ff) 7%,transparent)!important;
  outline:none;
}
.library-empty-state{
  display:none;
  grid-column:1/-1;
  min-height:240px;
  place-items:center;
  text-align:center;
  border:1px dashed rgba(150,224,255,.12);
  border-radius:24px;
  background:rgba(255,255,255,.015);
  color:#6e8798;
  padding:38px;
}
.library-empty-state.is-visible{display:grid;}
.library-empty-state b{display:block;color:#d9faff;font-size:clamp(18px,2vw,28px);margin-bottom:8px;}
.library-empty-state span{display:block;max-width:520px;font-size:11px;line-height:1.55;}

@media(max-width:1180px){
  body[data-os-page="library"] .library-full{grid-template-columns:repeat(2,minmax(0,1fr))!important;}
  body[data-os-page="home"] .spotlight-art-stage{min-height:clamp(260px,38vw,420px);}
}
@media(max-width:800px){
  body[data-os-page="library"] .library-showcase-hero{grid-template-columns:1fr!important;}
  body[data-os-page="library"] .library-showcase-hero .page-hero-stat{display:none!important;}
  .library-filter-bar{overflow-x:auto;scrollbar-width:none;margin-inline:calc(var(--r493-safe-x) * -1);padding-inline:var(--r493-safe-x);}
  .library-filter-bar::-webkit-scrollbar{display:none;}
  .library-filter-count{display:none;}
}
@media(max-width:720px){
  :root{--r493-safe-x:max(14px,env(safe-area-inset-left));}
  body[data-os-page="library"] .console-page{padding-top:24px!important;}
  body[data-os-page="library"] .library-full{grid-template-columns:1fr!important;gap:14px!important;}
  body[data-os-page="library"] .library-showcase-hero{padding-top:18px!important;padding-bottom:24px!important;}
  body[data-os-page="library"] .library-showcase-hero h1{font-size:clamp(46px,15vw,68px)!important;}
  body[data-os-page="home"] .console-home-hero{border-radius:20px;}
  body[data-os-page="home"] .spotlight-art-stage{min-height:250px;}
  body[data-os-page="home"] .spotlight-art-stage img{max-width:72%!important;max-height:70%!important;}
}
@media(prefers-reduced-motion:reduce){
  body[data-os-page="home"] .console-home-hero.is-switching .spotlight-art-stage img,
  body[data-os-page="home"] .console-home-hero.is-switching .console-hero-copy h1,
  body[data-os-page="home"] .console-home-hero.is-switching .console-hero-copy p{animation:none!important;}
  .library-filter-bar button,body[data-os-page="library"] .library-console-card{transition:none!important;}
}
