/* ANIMLE stats panel: manga panels, hard shadows, tier colours. Needs style.css tokens. */

.st-root {
  container-type: inline-size;
  display: grid; gap: 24px; width: 100%; max-width: 860px; margin: 0 auto;
  text-align: left; color: var(--ink);
}

/* ---------- panel shell ---------- */
.st-panel {
  position: relative; min-width: 0;
  padding: 16px clamp(12px, 3.6cqi, 24px) 18px;
  background: linear-gradient(170deg, var(--panel-2), var(--panel));
  border: 3px solid #000; border-radius: 10px;
  box-shadow: 0 0 0 2px var(--line), 6px 6px 0 #000;
}
.st-panel::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: 7px; opacity: .55;
  background-image: radial-gradient(rgba(255,255,255,.08) 1.2px, transparent 1.6px); background-size: 9px 9px;
  -webkit-mask-image: linear-gradient(135deg, #000, transparent 55%); mask-image: linear-gradient(135deg, #000, transparent 55%);
}
.st-panel > * { position: relative; }

.st-head { display: flex; align-items: center; gap: 12px; margin: 0 0 12px; }
.st-title {
  display: flex; align-items: center; gap: 10px; margin: 0;
  font-family: var(--f-display); font-weight: 400; font-size: 18px; line-height: 1;
  text-transform: uppercase; letter-spacing: .01em; color: var(--ink); text-shadow: 2px 2px 0 #000;
  transform: skewX(-4deg);
}
.st-title::before {
  content: ""; flex: none; width: 11px; height: 11px; transform: rotate(45deg);
  background: var(--pink); border: 2px solid #000; box-shadow: 0 0 10px rgba(255,77,148,.6);
}
.st-cap { margin-left: auto; font-family: var(--f-pixel); font-size: 12px; letter-spacing: .12em; color: var(--mute); text-align: right; }

/* ---------- 1. percentile ---------- */
.st-pct {
  text-align: center; padding-top: 20px; padding-bottom: 20px;
  background:
    repeating-conic-gradient(from 0deg at 100% 0%, rgba(255,77,148,.11) 0 4deg, transparent 4deg 12deg),
    repeating-conic-gradient(from 0deg at 0% 100%, rgba(45,226,230,.08) 0 4deg, transparent 4deg 12deg),
    linear-gradient(170deg, var(--panel-2), var(--panel));
}
.st-kicker { font-family: var(--f-pixel); font-size: 13px; letter-spacing: .26em; color: var(--cyan); margin: 0 0 6px; }
.st-pct-line {
  margin: 0; font-family: var(--f-pixel); font-size: clamp(19px, 5.2cqi, 34px); line-height: 1.3;
  letter-spacing: .04em; text-wrap: balance; text-shadow: 2px 2px 0 #000;
}
.st-pct-num {
  display: inline-block; font-weight: 400; font-size: 1.9em; line-height: 1; margin: 0 .08em;
  color: var(--gold); transform: skewX(-6deg) translateY(.04em);
  text-shadow: 3px 3px 0 #000, 0 0 22px rgba(255,209,102,.45);
}
.st-meter {
  --p: 50%;
  position: relative; height: 16px; margin: 16px auto 0; max-width: 560px;
  background: #100d24; border: 3px solid #000; border-radius: 4px; box-shadow: 0 0 0 2px var(--line), 3px 3px 0 #000;
}
.st-meter::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(90deg, transparent 0 calc(10% - 2px), rgba(0,0,0,.55) calc(10% - 2px) 10%);
}
.st-meter-fill {
  position: absolute; inset: 0; display: block;
  background: linear-gradient(90deg, var(--slate), var(--cyan) 28%, var(--violet) 55%, var(--pink) 78%, var(--gold));
  clip-path: inset(0 calc(100% - var(--p)) 0 0);
}
.st-meter-pin {
  position: absolute; top: 50%; left: var(--p); width: 14px; height: 14px; margin: -7px 0 0 -7px;
  background: var(--pink); border: 3px solid #000; transform: rotate(45deg); box-shadow: 0 0 10px rgba(255,77,148,.7);
}
.st-note { margin: 14px auto 0; max-width: 520px; font-family: var(--f-pixel); font-size: 13px; line-height: 1.45; letter-spacing: .04em; color: var(--mute); }

/* ---------- svg charts ---------- */
.st-host { width: 100%; min-height: 150px; }
.st-svg { display: block; width: 100%; height: auto; overflow: visible; }
.st-svg text { font-family: var(--f-pixel); }
.st-ax { fill: var(--mute); font-size: 12px; letter-spacing: .04em; }
.st-rn { fill: var(--ink); font-size: 13px; }

/* curve */
.st-stop { stop-color: var(--tc, var(--slate)); }
.st-gl { stroke: rgba(255,255,255,.07); stroke-width: 1; }
.st-bl { stroke: rgba(255,255,255,.2); stroke-width: 1; stroke-dasharray: 2 4; }
.st-curve-ol { fill: none; stroke: #000; stroke-width: 7; stroke-linejoin: round; stroke-linecap: round; }
.st-curve { fill: none; stroke-width: 3.2; stroke-linejoin: round; stroke-linecap: round; }
.st-base-ol { stroke: #000; stroke-width: 6; stroke-linecap: square; }
.st-base { stroke: var(--line); stroke-width: 2; stroke-linecap: square; }
.st-tick { stroke: var(--mute); stroke-width: 1.5; }
.st-pin-ol { stroke: #000; stroke-width: 6; }
.st-pin-l { stroke: var(--pink); stroke-width: 2.5; }
.st-pin-dot { fill: var(--pink); stroke: #000; stroke-width: 3; }
.st-flag { fill: var(--pink); stroke: #000; stroke-width: 2.5; stroke-linejoin: round; }
.st-flag-sh { fill: #000; stroke: none; }
.st-flag-t { fill: #2a0618; font-size: 13px; letter-spacing: .05em; }

/* log */
.st-col { fill: rgba(255,255,255,.03); }
.st-guide { stroke: var(--tc, var(--miss)); stroke-opacity: .3; stroke-width: 1; stroke-dasharray: 2 5; }
.st-rl { fill: var(--tc, var(--mute)); font-size: 12px; letter-spacing: .04em; }
.st-row-miss .st-rl { fill: var(--mute); opacity: .75; }
.st-row-miss .st-guide { stroke-opacity: .5; }
.st-link { fill: none; stroke: var(--ink); stroke-opacity: .22; stroke-width: 1.5; stroke-dasharray: 3 4; stroke-linejoin: round; }
.st-drop { stroke: var(--tc); stroke-opacity: .6; stroke-width: 1.5; }
.st-ic-sh { fill: #000; }
.st-dia { fill: var(--tc); stroke: #000; stroke-width: 2.5; stroke-linejoin: miter; }
.st-dia-in { fill: #fff; fill-opacity: .38; }
.st-pts { fill: var(--ink); font-size: 12px; letter-spacing: .02em; }
.st-hit { fill: transparent; }
.st-ic { cursor: help; }
.st-ic:hover .st-dia { fill: #fff; }
.st-ic[data-tier="super"] .st-dia, .st-ic[data-tier="ultra"] .st-dia { filter: drop-shadow(0 0 5px rgba(var(--tcr), .85)); }
.st-ic[data-tier="miss"] .st-dia { fill: rgba(var(--tcr), .16); stroke: var(--tc); stroke-width: 2; stroke-dasharray: 3 2; }
.st-ic[data-tier="miss"] .st-ic-sh { opacity: .5; }
.st-ic[data-tier="miss"] .st-pts { fill: var(--mute); }
.st-x { fill: none; stroke: var(--tc); stroke-width: 2.2; stroke-linecap: round; }

/* ---------- 4. the bearing ---------- */
.st-bands { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.st-band {
  position: relative; display: grid; grid-template-columns: 22px 78px minmax(150px, 215px) 1fr; align-items: center; gap: 3px 12px;
  padding: 10px 14px 10px 10px; border: 2px solid var(--line); border-radius: 6px; background: rgba(16,13,36,.6);
}
.st-pip {
  justify-self: center; width: 13px; height: 13px; transform: rotate(45deg);
  background: var(--tc); border: 2px solid #000; box-shadow: 0 0 10px rgba(var(--tcr), .55);
}
.st-range { font-family: var(--f-pixel); font-size: 16px; letter-spacing: .04em; color: var(--tc); }
.st-nm { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; min-width: 0; }
.st-bname { font-family: var(--f-display); font-weight: 400; font-size: 15px; line-height: 1.1; text-transform: uppercase; color: var(--ink); }
.st-verdict { font-size: 14px; line-height: 1.35; color: var(--mute); }
.st-band.on {
  border: 3px solid var(--tc); padding: 9px 13px 9px 9px;
  background: linear-gradient(90deg, rgba(var(--tcr), .26), rgba(var(--tcr), .07) 75%);
  box-shadow: 4px 4px 0 #000, 0 0 0 1px #000, 0 0 22px rgba(var(--tcr), .25);
}
.st-band.on .st-verdict { color: var(--ink); }
.st-band.on .st-bname { text-shadow: 2px 2px 0 #000; }
.st-you {
  font-style: normal; font-family: var(--f-pixel); font-size: 12px; letter-spacing: .14em; line-height: 1;
  padding: 4px 8px 3px; background: var(--pink); color: #2a0618; border: 2px solid #000; border-radius: 3px; box-shadow: 2px 2px 0 #000;
}

@container (max-width: 560px) {
  .st-band { grid-template-columns: 22px 70px 1fr; }
  .st-band .st-pip { grid-row: span 2; align-self: start; margin-top: 4px; }
  .st-band .st-verdict { grid-column: 2 / -1; }
  .st-title { font-size: 16px; }
  .st-cap { font-size: 11px; letter-spacing: .08em; }
}
@container (max-width: 380px) {
  .st-cap { display: none; }
}

/* ---------- motion ---------- */
@keyframes st-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes st-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes st-drop { from { opacity: 0; transform: translateY(-16px); } to { opacity: 1; transform: none; } }
@keyframes st-pindrop { from { opacity: 0; transform: translateY(-22px); } to { opacity: 1; transform: none; } }
@keyframes st-unveil { from { clip-path: inset(0 100% 0 0); } }
@keyframes st-pop { from { opacity: 0; transform: rotate(45deg) scale(0); } to { opacity: 1; transform: rotate(45deg) scale(1); } }

.st-draw { stroke-dasharray: 1; stroke-dashoffset: 0; animation: st-draw 1.5s cubic-bezier(.45,.05,.3,1) .15s both; }
.st-area.st-anim { animation: st-fade .9s ease-out .9s both; }
.st-pin.st-anim { animation: st-pindrop .5s cubic-bezier(.2,1.3,.4,1) 1.45s both; }
.st-ic.st-anim { animation: st-drop .55s cubic-bezier(.2,1.3,.4,1) calc(.15s + var(--i, 0) * .09s) both; }
.st-link.st-anim { animation: st-fade .6s ease-out .85s both; }
.st-meter-fill.st-anim { animation: st-unveil 1.1s cubic-bezier(.2,.8,.2,1) .2s both; }
.st-meter-pin.st-anim { animation: st-pop .4s cubic-bezier(.2,1.5,.4,1) 1.1s both; }

/* hold animations until the panel is on screen */
.st-wait .st-anim, .st-wait .st-draw { animation-play-state: paused; }

/* static: reduced motion, low-power, and resize redraws */
.st-static .st-anim, .st-static .st-draw, .st-static.st-panel .st-anim, .st-static.st-panel .st-draw { animation: none !important; }
.st-static .st-draw, .st-static.st-panel .st-draw { stroke-dasharray: none; }
@media (prefers-reduced-motion: reduce) {
  .st-anim, .st-draw { animation: none !important; }
  .st-draw { stroke-dasharray: none; }
}
body.low .st-anim, body.low .st-draw { animation: none !important; }
body.low .st-draw { stroke-dasharray: none; }
