/* UI 017.1.1 — Home HUD & Progress Polish
   Additive layer over stable 017.0.14. Does not alter scrolling, dock placement,
   activities geometry, battle UI or server progression. */

body.i13-home-open .i13-topbar{
  grid-template-columns:minmax(148px,1fr) auto!important;
  gap:6px!important;
}

body.i13-home-open .i13-profile{
  width:100%!important;
  min-width:0!important;
  overflow:hidden!important;
  gap:7px!important;
}
body.i13-home-open .i13-profile-copy{
  flex:1 1 auto!important;
  width:auto!important;
  min-width:0!important;
  max-width:none!important;
  overflow:hidden!important;
}
body.i13-home-open .i13-player-name{
  display:block!important;
  width:100%!important;
  max-width:100%!important;
  overflow:hidden!important;
  text-overflow:clip!important;
  white-space:nowrap!important;
  letter-spacing:-.012em!important;
  transform-origin:0 50%;
}
body.i13-home-open .i13-player-level{
  white-space:nowrap!important;
  font-variant-numeric:tabular-nums;
}
body.i13-home-open .i13-header-xp{
  overflow:hidden;
  border-color:rgba(218,166,77,.42)!important;
  background:rgba(3,3,8,.92)!important;
  box-shadow:inset 0 1px 2px #000,0 0 0 1px rgba(255,235,180,.035)!important;
}
body.i13-home-open .i13-header-xp i{
  position:relative;
  overflow:hidden;
  transition:width .42s cubic-bezier(.2,.75,.24,1)!important;
}
body.i13-home-open .i13-header-xp i:after{
  content:"";
  position:absolute;
  inset:0;
  background:linear-gradient(90deg,transparent 0 55%,rgba(255,236,177,.55) 82%,transparent 100%);
  opacity:.42;
}

body.i13-home-open .i13-resources{
  flex:0 0 auto!important;
  gap:4px!important;
}
body.i13-home-open .i13-resource{
  min-width:50px!important;
  padding-left:6px!important;
  padding-right:7px!important;
  font-variant-numeric:tabular-nums;
}
body.i13-home-open .i13-resource b,
body.i13-home-open .i13-streak b{
  font-variant-numeric:tabular-nums;
  white-space:nowrap;
}
body.i13-home-open .i13-streak{
  width:68px!important;
  min-width:68px!important;
  padding-left:5px!important;
  padding-right:5px!important;
}
body.i13-home-open .i13-streak small{
  letter-spacing:.025em!important;
}

/* The scene XP row is the single detailed XP source on Home. The old level panel
   repeated the same level/XP values immediately below the scene, so 017.1 removes
   only that duplicate surface. */
body.i13-home-open .i13-level-panel{
  display:none!important;
}
body.i13-home-open .i13-characteristics{
  margin-top:6px!important;
}

body.i13-home-open .i13-stat-exp{
  position:relative;
}
body.i13-home-open .i13-stat-exp .i13-stat-track{
  position:relative;
  overflow:visible!important;
  isolation:isolate;
}
body.i13-home-open .i13-stat-exp .i13-stat-track > i[data-bind="exp-bar"]{
  overflow:hidden;
  border-radius:999px;
  transition:width .48s cubic-bezier(.2,.76,.25,1)!important;
}
body.i13-home-open .i171-xp-marker{
  position:absolute;
  z-index:4;
  top:50%;
  left:var(--i171-pos);
  width:7px;
  height:7px;
  margin:0;
  padding:0;
  translate:-50% -50%;
  rotate:45deg;
  border:1px solid rgba(231,193,112,.66);
  border-radius:1px;
  background:#131019;
  box-shadow:0 0 4px rgba(220,169,73,.22);
  pointer-events:none;
}
body.i13-home-open .i171-xp-marker.is-done{
  border-color:#ffe0a0;
  background:#d7a64d;
  box-shadow:0 0 6px rgba(239,181,77,.52);
}
body.i13-home-open .i171-xp-marker.is-next{
  border-color:#ffe9b5;
  background:#983db5;
  box-shadow:0 0 7px rgba(207,86,242,.72),0 0 4px rgba(236,188,91,.42);
}

body.i13-home-open .i13-stat-exp.i171-xp-gain .i13-stat-medallion{
  animation:i171-xp-medallion .72s ease-out both;
}
body.i13-home-open .i13-stat-exp.i171-xp-gain .i13-stat-track{
  animation:i171-xp-track .72s ease-out both;
}
body.i13-home-open .i13-header-xp.i171-xp-gain{
  animation:i171-header-xp .72s ease-out both;
}
body.i13-home-open .i13-topbar.i171-level-up{
  animation:i171-level-up .9s ease-out both;
}

@keyframes i171-xp-medallion{
  0%{filter:none;transform:scale(1)}
  38%{filter:drop-shadow(0 0 9px rgba(208,87,244,.8)) drop-shadow(0 0 4px rgba(243,194,94,.5));transform:scale(1.08)}
  100%{filter:none;transform:scale(1)}
}
@keyframes i171-xp-track{
  0%{box-shadow:inset 0 1px 2px #000,0 0 0 1px rgba(255,234,190,.06)}
  38%{box-shadow:inset 0 1px 2px #000,0 0 10px rgba(198,74,235,.72),0 0 4px rgba(236,183,81,.42)}
  100%{box-shadow:inset 0 1px 2px #000,0 0 0 1px rgba(255,234,190,.06)}
}
@keyframes i171-header-xp{
  0%,100%{filter:none}
  40%{filter:drop-shadow(0 0 7px rgba(195,72,232,.72)) drop-shadow(0 0 3px rgba(235,184,82,.4))}
}
@keyframes i171-level-up{
  0%,100%{box-shadow:inherit}
  35%{box-shadow:0 8px 25px rgba(0,0,0,.56),inset 0 0 28px rgba(212,163,73,.15),0 0 16px rgba(211,157,69,.28)}
}

@media(max-width:390px){
  body.i13-home-open .i13-topbar{
    grid-template-columns:minmax(136px,1fr) auto!important;
    gap:4px!important;
  }
  body.i13-home-open .i13-profile{gap:6px!important}
  body.i13-home-open .i13-resource{
    min-width:45px!important;
    padding-left:5px!important;
    padding-right:5px!important;
  }
  body.i13-home-open .i13-streak{
    width:62px!important;
    min-width:62px!important;
    padding-left:4px!important;
    padding-right:4px!important;
  }
}

@media(max-width:350px){
  body.i13-home-open .i13-topbar{
    grid-template-columns:minmax(124px,1fr) auto!important;
    gap:3px!important;
  }
  body.i13-home-open .i13-resource{
    min-width:41px!important;
    padding-left:4px!important;
    padding-right:4px!important;
  }
  body.i13-home-open .i13-streak{
    width:57px!important;
    min-width:57px!important;
  }
}

@media(prefers-reduced-motion:reduce){
  body.i13-home-open .i13-stat-exp.i171-xp-gain .i13-stat-medallion,
  body.i13-home-open .i13-stat-exp.i171-xp-gain .i13-stat-track,
  body.i13-home-open .i13-header-xp.i171-xp-gain,
  body.i13-home-open .i13-topbar.i171-level-up{
    animation:none!important;
  }
}
