/* UI 017.4.3 SAFE CANARY — single verdict + premium persistent Victory Result
   Targets Battle014's existing .battle014-finished card after A6 verdict.
   Canary presentation only: keep 0165/A6 lifecycle and events intact, but suppress
   the obsolete 0165 visual finale and native triumph overlay from first paint. */

/* 0174 CSS is injected only for ?result_ui=0174safe, so suppress the legacy
   reward overlay before JS has a chance to enhance the persistent finished card.
   This removes the one-frame XP/reward flash without changing reward logic. */
#triumph-overlay{
  display:none!important;
  visibility:hidden!important;
  opacity:0!important;
  pointer-events:none!important;
}

/* 0165 still runs and keeps its internal timing/events, but A6 is the accepted
   visible terminal verdict owner. Hide only the old duplicate finale visual. */
body.arena-battle014-active #battle014-root .b165-finale{
  display:none!important;
  visibility:hidden!important;
  opacity:0!important;
  pointer-events:none!important;
}

body.arena-battle014-active #battle014-root > .battle014-finished{
  align-items:start;
  min-height:100%;
  padding:calc(22px + env(safe-area-inset-top)) 12px calc(92px + env(safe-area-inset-bottom));
}

body.arena-battle014-active #battle014-root .b14-finished-card.b174-premium-victory{
  --b174-gold:#f0c765;
  --b174-gold-hi:#ffe7a0;
  --b174-gold-deep:#8f5d20;
  --b174-purple:#8f28be;
  --b174-purple-hi:#c348e5;
  position:relative;
  isolation:isolate;
  width:min(94vw,560px);
  max-width:560px;
  padding:34px 24px 24px;
  overflow:hidden;
  border:1px solid rgba(240,199,101,.66);
  border-radius:28px;
  background:
    radial-gradient(circle at 50% -8%,rgba(244,204,112,.18),transparent 30%),
    radial-gradient(circle at 50% 40%,rgba(143,40,190,.11),transparent 44%),
    linear-gradient(180deg,#171020 0%,#110b19 56%,#09070f 100%);
  text-align:center;
  box-shadow:
    0 30px 82px rgba(0,0,0,.72),
    inset 0 0 0 1px rgba(255,236,181,.06),
    0 0 34px rgba(143,40,190,.08);
  animation:b174CardIn .34s cubic-bezier(.2,.8,.2,1) both;
}

body.arena-battle014-active #battle014-root .b14-finished-card.b174-premium-victory::before{
  content:"";
  position:absolute;
  inset:8px;
  z-index:-1;
  pointer-events:none;
  border:1px solid rgba(240,199,101,.20);
  border-radius:21px;
  box-shadow:inset 0 0 30px rgba(255,228,158,.018);
}

body.arena-battle014-active #battle014-root .b14-finished-card.b174-premium-victory::after{
  content:"";
  position:absolute;
  top:-42px;
  left:12%;
  right:12%;
  z-index:-2;
  height:150px;
  pointer-events:none;
  background:radial-gradient(ellipse at center,rgba(255,215,121,.22),rgba(154,61,190,.07) 46%,transparent 72%);
  filter:blur(3px);
}

body.arena-battle014-active #battle014-root .b174-premium-victory .b14-result-mark{
  position:relative;
  width:112px;
  height:104px;
  margin:0 auto 10px;
  display:grid;
  place-items:center;
  color:var(--b174-gold-hi);
  filter:drop-shadow(0 6px 12px rgba(0,0,0,.50));
}

body.arena-battle014-active #battle014-root .b174-premium-victory .b14-result-mark::before{
  content:"";
  position:absolute;
  inset:6px 3px;
  z-index:-1;
  border:1px solid rgba(240,199,101,.42);
  border-radius:30% 30% 42% 42%;
  background:
    radial-gradient(circle at 50% 28%,rgba(255,239,188,.10),transparent 34%),
    linear-gradient(180deg,rgba(44,24,49,.76),rgba(15,10,22,.92));
  box-shadow:
    0 0 0 7px rgba(255,255,255,.018),
    0 0 28px rgba(240,199,101,.13);
  clip-path:polygon(50% 0,90% 15%,90% 57%,75% 83%,50% 100%,25% 83%,10% 57%,10% 15%);
}

body.arena-battle014-active #battle014-root .b174-premium-victory .b14-result-mark .b14-icon{
  width:62px!important;
  height:62px!important;
  stroke:var(--b174-gold-hi)!important;
  stroke-width:1.7!important;
  fill:none!important;
  filter:drop-shadow(0 0 9px rgba(240,199,101,.20));
}

body.arena-battle014-active #battle014-root .b174-premium-victory h1{
  margin:9px 0 0;
  color:#f7d98c;
  font-family:Georgia,"Times New Roman",serif;
  font-size:clamp(42px,11vw,62px);
  font-weight:700;
  line-height:.96;
  letter-spacing:-.035em;
  text-shadow:
    0 3px 0 rgba(92,55,17,.26),
    0 7px 18px rgba(0,0,0,.66),
    0 0 24px rgba(240,199,101,.16);
}

body.arena-battle014-active #battle014-root .b174-subtitle{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:12px;
  margin:17px auto 0;
  color:#d6cdcf;
  font-size:clamp(14px,4vw,19px);
  font-weight:650;
  letter-spacing:.01em;
}

body.arena-battle014-active #battle014-root .b174-subtitle::before,
body.arena-battle014-active #battle014-root .b174-subtitle::after{
  content:"";
  width:52px;
  max-width:12vw;
  height:1px;
  background:linear-gradient(90deg,transparent,rgba(240,199,101,.78));
  box-shadow:0 0 7px rgba(240,199,101,.18);
}
body.arena-battle014-active #battle014-root .b174-subtitle::after{transform:scaleX(-1)}

body.arena-battle014-active #battle014-root .b174-source-hidden{display:none!important}

body.arena-battle014-active #battle014-root .b174-rewards-title{
  position:relative;
  margin:22px 0 13px;
  padding-top:17px;
  color:#ddb35a;
  font-size:11px;
  font-weight:850;
  letter-spacing:.14em;
  text-transform:uppercase;
}

body.arena-battle014-active #battle014-root .b174-rewards-title::before{
  content:"";
  position:absolute;
  top:0;
  left:14%;
  right:14%;
  height:1px;
  background:linear-gradient(90deg,transparent,rgba(240,199,101,.25),rgba(187,67,218,.18),rgba(240,199,101,.25),transparent);
}

body.arena-battle014-active #battle014-root .b174-rewards{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:10px;
}

body.arena-battle014-active #battle014-root .b174-reward{
  min-width:0;
  min-height:82px;
  display:grid;
  grid-template-columns:44px minmax(0,1fr);
  gap:10px;
  align-items:center;
  padding:12px 12px;
  border:1px solid rgba(240,199,101,.27);
  border-radius:16px;
  background:
    radial-gradient(circle at 18% 24%,rgba(240,199,101,.07),transparent 42%),
    linear-gradient(180deg,rgba(28,19,36,.92),rgba(11,9,17,.96));
  text-align:left;
  box-shadow:inset 0 0 18px rgba(255,255,255,.018),0 10px 24px rgba(0,0,0,.20);
}

body.arena-battle014-active #battle014-root .b174-reward-icon{
  width:43px;
  height:43px;
  display:grid;
  place-items:center;
  border:1px solid rgba(255,226,151,.52);
  border-radius:50%;
  background:
    radial-gradient(circle at 34% 28%,rgba(255,255,255,.28),transparent 22%),
    linear-gradient(145deg,#a97026,#392515);
  color:#ffe59b;
  font-family:Georgia,"Times New Roman",serif;
  font-size:14px;
  font-weight:900;
  box-shadow:inset 0 0 0 3px rgba(16,11,15,.30),0 0 14px rgba(240,199,101,.10);
}
body.arena-battle014-active #battle014-root .b174-reward-gold .b174-reward-icon{font-size:24px}

body.arena-battle014-active #battle014-root .b174-reward-copy{min-width:0;display:block}
body.arena-battle014-active #battle014-root .b174-reward-copy strong{
  display:block;
  overflow:hidden;
  color:#f6d786;
  font-family:Georgia,"Times New Roman",serif;
  font-size:clamp(24px,6vw,32px);
  font-weight:700;
  line-height:1;
  text-overflow:ellipsis;
  white-space:nowrap;
}
body.arena-battle014-active #battle014-root .b174-reward-copy small{
  display:block;
  margin-top:4px;
  color:#c6bdc0;
  font-size:11px;
  font-weight:650;
  letter-spacing:.03em;
}

body.arena-battle014-active #battle014-root .b174-heat{
  min-height:62px;
  display:grid;
  grid-template-columns:38px 1fr auto;
  gap:10px;
  align-items:center;
  margin-top:11px;
  padding:10px 13px;
  border:1px solid rgba(190,58,215,.43);
  border-radius:15px;
  background:
    radial-gradient(circle at 13% 50%,rgba(240,199,101,.08),transparent 31%),
    linear-gradient(90deg,rgba(30,14,38,.96),rgba(18,9,28,.96));
}
body.arena-battle014-active #battle014-root .b174-heat-icon{font-size:26px}
body.arena-battle014-active #battle014-root .b174-heat-label{color:#dfc17b;font-size:13px;font-weight:760;text-align:left}
body.arena-battle014-active #battle014-root .b174-heat strong{color:#f5d689;font:700 20px Georgia,"Times New Roman",serif}

body.arena-battle014-active #battle014-root .b174-premium-victory > p:not(.b174-source-hidden){
  margin:17px 4px 0;
  color:#c8bfc1;
  font-size:13px;
  line-height:1.55;
}

body.arena-battle014-active #battle014-root .b174-premium-victory .b14-primary{
  position:relative;
  min-height:60px;
  width:100%;
  margin-top:20px;
  padding:12px 18px;
  border:1px solid #dfb665;
  border-radius:15px;
  background:
    linear-gradient(180deg,rgba(255,255,255,.11),transparent 27%),
    linear-gradient(135deg,#7424a5 0%,#9b22b9 48%,#671d84 100%);
  color:#fff4d4;
  font-size:clamp(16px,4.7vw,21px);
  font-weight:760;
  letter-spacing:.025em;
  text-transform:uppercase;
  text-shadow:0 2px 7px rgba(0,0,0,.58);
  box-shadow:
    inset 0 0 0 3px rgba(19,8,30,.46),
    inset 0 0 18px rgba(230,95,255,.10),
    0 0 0 3px rgba(141,40,190,.10),
    0 10px 24px rgba(0,0,0,.33);
}
body.arena-battle014-active #battle014-root .b174-premium-victory .b14-primary .b14-icon{
  width:20px;
  height:20px;
  margin-right:7px;
  vertical-align:-4px;
}

@keyframes b174CardIn{
  from{opacity:0;transform:translateY(8px) scale(.986)}
  to{opacity:1;transform:translateY(0) scale(1)}
}

@media(max-width:430px){
  body.arena-battle014-active #battle014-root > .battle014-finished{
    padding:calc(14px + env(safe-area-inset-top)) 10px calc(86px + env(safe-area-inset-bottom));
  }
  body.arena-battle014-active #battle014-root .b14-finished-card.b174-premium-victory{
    width:96vw;
    padding:27px 18px 19px;
    border-radius:24px;
  }
  body.arena-battle014-active #battle014-root .b174-premium-victory .b14-result-mark{
    width:100px;
    height:92px;
    margin-bottom:7px;
  }
  body.arena-battle014-active #battle014-root .b174-premium-victory .b14-result-mark .b14-icon{
    width:56px!important;
    height:56px!important;
  }
  body.arena-battle014-active #battle014-root .b174-rewards{gap:8px}
  body.arena-battle014-active #battle014-root .b174-reward{
    grid-template-columns:38px minmax(0,1fr);
    gap:8px;
    min-height:76px;
    padding:10px;
  }
  body.arena-battle014-active #battle014-root .b174-reward-icon{width:38px;height:38px;font-size:12px}
  body.arena-battle014-active #battle014-root .b174-reward-gold .b174-reward-icon{font-size:21px}
}

@media(prefers-reduced-motion:reduce){
  body.arena-battle014-active #battle014-root .b14-finished-card.b174-premium-victory{animation:none!important}
}
