/* OSANIME Modern Adaptive Header + Back To Top v173
   Premium shared header for guest/member pages. No external dependency. */

:root{
  --osanime-header-pink:#ff4f93;
  --osanime-header-violet:#9a6cff;
  --osanime-header-blue:#60a5fa;
  --osanime-header-surface:rgba(5,10,23,.82);
  --osanime-header-surface-strong:rgba(5,10,23,.94);
  --osanime-header-border:rgba(255,255,255,.075);
  --osanime-header-shadow:0 18px 50px rgba(0,0,0,.34);
  --osanime-scroll-progress:0;
  --osanime-backtop-bottom:22px;
}

/* overflow:hidden on .page would make sticky attach to that element instead of the viewport. */
body.index-php-page main.page{overflow:clip!important;}

body.index-php-page .topbar.osanime-header{
  position:sticky!important;
  top:0!important;
  z-index:10020!important;
  overflow:visible!important;
  isolation:isolate;
  border:1px solid transparent!important;
  border-bottom-color:var(--osanime-header-border)!important;
  background:
    radial-gradient(42% 130% at 16% -55%,rgba(255,79,147,.12),transparent 68%),
    radial-gradient(38% 120% at 88% -60%,rgba(96,165,250,.09),transparent 70%),
    linear-gradient(180deg,rgba(5,10,23,.96),var(--osanime-header-surface))!important;
  -webkit-backdrop-filter:blur(16px) saturate(145%);
  backdrop-filter:blur(16px) saturate(145%);
  box-shadow:0 1px 0 rgba(255,255,255,.025) inset;
  transform:translate3d(0,0,0);
  transition:
    transform .34s cubic-bezier(.22,.78,.22,1),
    top .28s cubic-bezier(.22,.78,.22,1),
    margin .28s cubic-bezier(.22,.78,.22,1),
    border-radius .28s cubic-bezier(.22,.78,.22,1),
    border-color .24s ease,
    background-color .24s ease,
    box-shadow .24s ease,
    height .28s cubic-bezier(.22,.78,.22,1),
    padding .28s cubic-bezier(.22,.78,.22,1)!important;
}

/* Premium floating-island state once the page is moving. */
body.index-php-page.osanime-header-scrolled .topbar.osanime-header{
  top:8px!important;
  margin-inline:clamp(8px,1.2vw,18px)!important;
  border-color:rgba(255,255,255,.10)!important;
  border-bottom-color:rgba(255,79,147,.17)!important;
  border-radius:18px!important;
  background:
    radial-gradient(45% 150% at 17% -70%,rgba(255,79,147,.18),transparent 68%),
    radial-gradient(40% 150% at 86% -80%,rgba(139,92,246,.14),transparent 68%),
    linear-gradient(180deg,rgba(8,14,29,.94),rgba(5,10,23,.84))!important;
  -webkit-backdrop-filter:blur(22px) saturate(165%);
  backdrop-filter:blur(22px) saturate(165%);
  box-shadow:
    0 18px 52px rgba(0,0,0,.34),
    0 1px 0 rgba(255,255,255,.055) inset,
    0 0 0 1px rgba(255,79,147,.025)!important;
}

body.index-php-page.osanime-header-hidden .topbar.osanime-header{
  transform:translate3d(0,calc(-100% - 20px),0)!important;
  box-shadow:none!important;
}

/* Never hide while a header interaction needs a stable anchor. */
body.index-php-page.profile-menu-is-open .topbar.osanime-header,
body.index-php-page.sidebar-is-open .topbar.osanime-header,
body.index-php-page .topbar.osanime-header.search-open,
body.index-php-page .topbar.osanime-header:focus-within{
  transform:translate3d(0,0,0)!important;
}

/* Reading progress rail: understated at the top, brighter on a floating header. */
.osanime-header-progress{
  position:absolute;
  z-index:10026;
  left:14px;
  right:14px;
  bottom:-1px;
  height:2px;
  overflow:hidden;
  border-radius:999px;
  background:rgba(255,255,255,.035);
  pointer-events:none;
  opacity:.82;
}
.osanime-header-progress-value{
  display:block;
  width:100%;
  height:100%;
  border-radius:inherit;
  transform:scaleX(var(--osanime-scroll-progress));
  transform-origin:left center;
  background:linear-gradient(90deg,var(--osanime-header-pink),#f472b6 34%,var(--osanime-header-violet) 67%,var(--osanime-header-blue));
  box-shadow:0 0 12px rgba(255,79,147,.48);
  transition:transform .07s linear;
}
body.index-php-page:not(.osanime-header-scrolled) .osanime-header-progress{left:0;right:0;border-radius:0;}

/* Brand motion is subtle so the logo remains crisp. */
body.index-php-page .topbar.osanime-header>.site-brand,
body.index-php-page .topbar.osanime-header>.logo{
  transform-origin:left center;
  transition:transform .26s cubic-bezier(.22,.78,.22,1),opacity .2s ease!important;
}
body.index-php-page.osanime-header-scrolled .topbar.osanime-header>.site-brand,
body.index-php-page.osanime-header-scrolled .topbar.osanime-header>.logo{
  transform:scale(.955);
}

/* Navigation: soft pill hover + a precise active marker instead of heavy blocks. */
body.index-php-page .topbar.osanime-header .site-nav>a,
body.index-php-page .topbar.osanime-header .site-nav-dropdown>button,
body.index-php-page .topbar.osanime-header .nav>a,
body.index-php-page .topbar.osanime-header .nav-dropdown>button{
  position:relative;
  border-radius:11px!important;
  transition:background .17s ease,color .17s ease,transform .17s ease,border-color .17s ease,box-shadow .17s ease!important;
}
body.index-php-page .topbar.osanime-header .site-nav>a:hover,
body.index-php-page .topbar.osanime-header .site-nav-dropdown>button:hover,
body.index-php-page .topbar.osanime-header .nav>a:hover,
body.index-php-page .topbar.osanime-header .nav-dropdown>button:hover{
  background:rgba(255,255,255,.055)!important;
  color:#fff!important;
  transform:translateY(-1px);
  box-shadow:0 1px 0 rgba(255,255,255,.035) inset;
}
body.index-php-page .topbar.osanime-header .site-nav>a.active,
body.index-php-page .topbar.osanime-header .nav>a.active{
  color:#fff!important;
  background:linear-gradient(135deg,rgba(255,79,147,.13),rgba(139,92,246,.085))!important;
  box-shadow:0 0 0 1px rgba(255,79,147,.10) inset;
}
body.index-php-page .topbar.osanime-header .site-nav>a.active::after,
body.index-php-page .topbar.osanime-header .nav>a.active::after{
  content:"";
  position:absolute;
  left:50%;
  bottom:4px;
  width:14px;
  height:2px;
  border-radius:999px;
  background:linear-gradient(90deg,var(--osanime-header-pink),var(--osanime-header-violet));
  box-shadow:0 0 9px rgba(255,79,147,.55);
  transform:translateX(-50%);
}

/* Search becomes a clean command-style field. */
body.index-php-page .topbar.osanime-header .site-search,
body.index-php-page .topbar.osanime-header>.search{
  border-color:rgba(255,255,255,.105)!important;
  background:rgba(7,16,32,.48)!important;
  box-shadow:0 1px 0 rgba(255,255,255,.025) inset!important;
  -webkit-backdrop-filter:blur(10px);
  backdrop-filter:blur(10px);
  transition:border-color .18s ease,background .18s ease,box-shadow .18s ease,transform .18s ease!important;
}
body.index-php-page .topbar.osanime-header .site-search:hover,
body.index-php-page .topbar.osanime-header>.search:hover{
  border-color:rgba(255,255,255,.16)!important;
  background:rgba(10,19,36,.58)!important;
}
body.index-php-page .topbar.osanime-header .site-search:focus-within,
body.index-php-page .topbar.osanime-header>.search:focus-within{
  border-color:rgba(255,79,147,.44)!important;
  background:rgba(9,18,36,.88)!important;
  box-shadow:0 0 0 3px rgba(255,79,147,.075),0 10px 28px rgba(0,0,0,.16)!important;
}

/* Icon buttons share one tactile visual language. */
body.index-php-page .topbar.osanime-header .hamb,
body.index-php-page .topbar.osanime-header .mobile-search,
body.index-php-page .topbar.osanime-header .mobile-notification-toggle,
body.index-php-page .topbar.osanime-header .mobile-user-avatar,
body.index-php-page .topbar.osanime-header .pm-header-message-button{
  border:1px solid rgba(255,255,255,.085)!important;
  background:rgba(255,255,255,.042)!important;
  box-shadow:0 7px 20px rgba(0,0,0,.13),0 1px 0 rgba(255,255,255,.035) inset!important;
  -webkit-backdrop-filter:blur(10px);
  backdrop-filter:blur(10px);
  transition:transform .17s ease,background .17s ease,border-color .17s ease,box-shadow .17s ease!important;
}
body.index-php-page .topbar.osanime-header .hamb:hover,
body.index-php-page .topbar.osanime-header .mobile-search:hover,
body.index-php-page .topbar.osanime-header .mobile-notification-toggle:hover,
body.index-php-page .topbar.osanime-header .mobile-user-avatar:hover,
body.index-php-page .topbar.osanime-header .pm-header-message-button:hover{
  transform:translateY(-1px);
  background:linear-gradient(145deg,rgba(255,79,147,.10),rgba(139,92,246,.065))!important;
  border-color:rgba(255,79,147,.25)!important;
  box-shadow:0 9px 25px rgba(0,0,0,.18),0 0 0 3px rgba(255,79,147,.04)!important;
}
body.index-php-page .topbar.osanime-header button:focus-visible,
body.index-php-page .topbar.osanime-header a:focus-visible,
body.index-php-page .topbar.osanime-header input:focus-visible{
  outline:2px solid rgba(255,79,147,.62)!important;
  outline-offset:3px!important;
}

body.index-php-page .topbar.osanime-header .site-auth-actions .btn,
body.index-php-page .topbar.osanime-header .guest-auth-actions .btn,
body.index-php-page .topbar.osanime-header .user-menu-toggle{
  transition:transform .17s ease,border-color .17s ease,background .17s ease,box-shadow .17s ease!important;
}
body.index-php-page .topbar.osanime-header .site-auth-actions .btn:hover,
body.index-php-page .topbar.osanime-header .guest-auth-actions .btn:hover,
body.index-php-page .topbar.osanime-header .user-menu-toggle:hover{transform:translateY(-1px);}

/* Keep all menus attached to the header's live geometry. */
body.index-php-page .topbar.osanime-header.search-open .site-search,
body.index-php-page .topbar.osanime-header.search-open>.search{top:calc(100% + 9px)!important;}

/* Back to top ---------------------------------------------------------- */
.osanime-back-to-top{
  position:fixed;
  z-index:9990;
  right:clamp(12px,2vw,26px);
  bottom:calc(var(--osanime-backtop-bottom) + env(safe-area-inset-bottom,0px));
  width:54px;
  height:54px;
  display:grid;
  place-items:center;
  padding:0;
  border:0;
  border-radius:18px;
  color:#fff;
  background:rgba(7,14,28,.78);
  box-shadow:0 16px 42px rgba(0,0,0,.38),0 0 0 1px rgba(255,255,255,.09) inset;
  -webkit-backdrop-filter:blur(16px) saturate(150%);
  backdrop-filter:blur(16px) saturate(150%);
  cursor:pointer;
  opacity:0;
  visibility:hidden;
  pointer-events:none;
  transform:translate3d(0,16px,0) scale(.88);
  transition:opacity .18s ease,visibility .18s ease,transform .30s cubic-bezier(.18,.9,.25,1.12),bottom .22s ease,box-shadow .18s ease!important;
}
.osanime-back-to-top::before{
  content:"";
  position:absolute;
  inset:5px;
  border-radius:14px;
  background:
    radial-gradient(circle at 28% 18%,rgba(255,255,255,.13),transparent 34%),
    linear-gradient(145deg,rgba(255,79,147,.11),rgba(139,92,246,.065) 55%,rgba(96,165,250,.055));
  pointer-events:none;
}
.osanime-back-to-top.is-visible{
  opacity:1;
  visibility:visible;
  pointer-events:auto;
  transform:translate3d(0,0,0) scale(1);
}
.osanime-back-to-top.is-visible:hover{
  transform:translate3d(0,-3px,0) scale(1.035);
  box-shadow:0 20px 50px rgba(0,0,0,.44),0 0 0 1px rgba(255,79,147,.24) inset,0 0 26px rgba(255,79,147,.11);
}
.osanime-back-to-top:active{transform:translate3d(0,-1px,0) scale(.97)!important;}
.osanime-back-to-top:focus-visible{outline:3px solid rgba(255,79,147,.34);outline-offset:4px;}

.osanime-back-to-top .osbt-progress{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  transform:rotate(-90deg);
  overflow:visible;
  pointer-events:none;
}
.osanime-back-to-top .osbt-progress-track,
.osanime-back-to-top .osbt-progress-value{fill:none;stroke-width:2.15;}
.osanime-back-to-top .osbt-progress-track{stroke:rgba(255,255,255,.085);}
.osanime-back-to-top .osbt-progress-value{
  stroke:url(#osbtGradientV173);
  stroke-linecap:round;
  stroke-dasharray:100;
  stroke-dashoffset:100;
  filter:drop-shadow(0 0 3px rgba(255,79,147,.48));
  transition:stroke-dashoffset .07s linear;
}
.osanime-back-to-top .osbt-core{
  position:relative;
  z-index:2;
  width:34px;
  height:34px;
  display:grid;
  place-items:center;
  border-radius:12px;
  background:rgba(255,255,255,.025);
  box-shadow:0 1px 0 rgba(255,255,255,.045) inset;
}
.osanime-back-to-top .osbt-arrow{
  width:20px;
  height:20px;
  filter:drop-shadow(0 3px 8px rgba(0,0,0,.32));
  transition:transform .18s ease;
}
.osanime-back-to-top:hover .osbt-arrow{transform:translateY(-2px);}
.osanime-back-to-top .osbt-tooltip{
  position:absolute;
  right:calc(100% + 10px);
  top:50%;
  transform:translate(5px,-50%);
  padding:7px 10px;
  border:1px solid rgba(255,255,255,.085);
  border-radius:9px;
  background:rgba(7,14,28,.92);
  color:#eef2f8;
  box-shadow:0 10px 28px rgba(0,0,0,.30);
  font-size:10px;
  font-weight:800;
  letter-spacing:.12px;
  white-space:nowrap;
  opacity:0;
  pointer-events:none;
  transition:opacity .16s ease,transform .16s ease;
  -webkit-backdrop-filter:blur(12px);
  backdrop-filter:blur(12px);
}
.osanime-back-to-top:hover .osbt-tooltip,
.osanime-back-to-top:focus-visible .osbt-tooltip{opacity:1;transform:translate(0,-50%);}

body.sidebar-is-open .osanime-back-to-top,
body.profile-menu-is-open .osanime-back-to-top{
  opacity:0!important;
  pointer-events:none!important;
  transform:translate3d(0,12px,0) scale(.9)!important;
}

/* Tablet / phone: compact floating island, safe for OSANIME mobile actions. */
@media(max-width:960px){
  body.index-php-page.osanime-header-scrolled .topbar.osanime-header{
    top:6px!important;
    margin-inline:6px!important;
    border-radius:16px!important;
    height:64px!important;
    padding-top:0!important;
    padding-bottom:0!important;
    -webkit-backdrop-filter:blur(18px) saturate(155%);
    backdrop-filter:blur(18px) saturate(155%);
  }
  .osanime-header-progress{left:10px;right:10px;}
  .osanime-back-to-top{right:10px;width:51px;height:51px;border-radius:17px;}
  .osanime-back-to-top::before{border-radius:13px;}
  .osanime-back-to-top .osbt-tooltip{display:none;}
}

@media(max-width:520px){
  body.index-php-page.osanime-header-scrolled .topbar.osanime-header{
    top:5px!important;
    margin-inline:5px!important;
    height:62px!important;
    border-radius:15px!important;
  }
  .osanime-back-to-top{right:9px;width:49px;height:49px;border-radius:16px;}
  .osanime-back-to-top .osbt-core{width:31px;height:31px;border-radius:11px;}
  .osanime-back-to-top .osbt-arrow{width:19px;height:19px;}
}

/* Degrade gracefully on devices without backdrop-filter instead of stacking transparency. */
@supports not ((backdrop-filter:blur(2px)) or (-webkit-backdrop-filter:blur(2px))){
  body.index-php-page .topbar.osanime-header,
  body.index-php-page.osanime-header-scrolled .topbar.osanime-header{background:rgba(5,10,23,.97)!important;}
  .osanime-back-to-top{background:rgba(7,14,28,.97);}
}

@media(forced-colors:active){
  .osanime-header-progress-value{background:Highlight;box-shadow:none;}
  .osanime-back-to-top{border:1px solid ButtonText;}
}

@media(prefers-reduced-motion:reduce){
  body.index-php-page .topbar.osanime-header,
  body.index-php-page .topbar.osanime-header *,
  .osanime-back-to-top,
  .osanime-back-to-top *{
    scroll-behavior:auto!important;
    animation:none!important;
    transition-duration:.01ms!important;
  }
  body.index-php-page.osanime-header-hidden .topbar.osanime-header{transform:none!important;}
}
