/* Track B Victory Breakout Layout CSS v1.0.3 — Anti-SaaS Hero-Breakout Result Screen (MIT)
 * Modeled directly from commercial Tiên Nghịch Mobile Result Screen (ref_01):
 *   - Top ~55%: Atmospheric open hero stage (NO dark SaaS box, ZERO flat CSS triangles!),
 *     2.1x scaled live-animated hero breaking downward across the 3-layer silk-cloud S-wave divider,
 *     wrapped in a soft golden-violet radial aura + rotating SVG arcane rune rings + golden sparks,
 *     with giant metallic-gold VICTORY emblem overlapping shoulder.
 *   - Bottom ~45%: Slim stage ribbon, compact 1-row duel/summary bar, glowing reward icon tiles,
 *     and 2 embossed metallic-gold pill CTAs.
 *   - WebView2 Guarantees: ZERO CSS blur filters, ZERO external Google Fonts, 720p/1080p overflow-safe!
 */
.tb-victory-breakout {
  position: fixed;
  inset: 0;
  z-index: 9500;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: radial-gradient(ellipse 84% 60% at 50% 24%, #454e7c 0%, #262c4a 52%, #171b30 100%);
  color: #f4f6ff;
  font-family: "Segoe UI", "Trebuchet MS", system-ui, -apple-system, sans-serif;
  user-select: none;
}

.tb-vb-hero-stage {
  position: relative;
  flex: 0 0 54%;
  min-height: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  overflow: visible;
}

/* Soft Multi-Layer Golden-Violet Atmospheric Aura & Rotating Arcane Halo behind Hero (NO z-index/isolation trap -> mix-blend-mode: screen melts pure #000000 seamlessly into sky!) */
.tb-vb-aura-backdrop {
  position: absolute;
  bottom: -8%;
  left: 50%;
  width: min(860px, 86vw);
  height: min(620px, 108%);
  margin-left: calc(min(860px, 86vw) * -0.5);
  pointer-events: none;
  mix-blend-mode: screen;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tb-vb-aura-glow {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background:
    radial-gradient(closest-side at 50% 52%, rgba(254, 240, 138, 0.34) 0%, rgba(168, 85, 247, 0.22) 44%, rgba(99, 102, 241, 0.08) 70%, transparent 98%);
  animation: tbVbAuraPulse 3.6s ease-in-out infinite;
}

@keyframes tbVbAuraPulse {
  0%, 100% { transform: scale(0.97); opacity: 0.88; }
  50%      { transform: scale(1.04); opacity: 1.0; }
}

.tb-vb-aura-rune-svg {
  position: relative;
  width: 82%;
  height: 82%;
  opacity: 0.62;
  animation: tbVbHaloSpin 26s linear infinite;
}

.tb-vb-aura-art-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0.94;
  -webkit-mask-image: radial-gradient(ellipse 68% 64% at 50% 52%, #000 45%, transparent 96%);
  mask-image: radial-gradient(ellipse 68% 64% at 50% 52%, #000 45%, transparent 96%);
  pointer-events: none;
}

.tb-vb-spark-dot {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle, #fffef0 0%, #fde047 55%, transparent 100%);
  pointer-events: none;
  animation: tbVbSparkFloat 3.2s ease-in-out infinite;
}

@keyframes tbVbSparkFloat {
  0%, 100% { transform: translateY(0) scale(0.85); opacity: 0.55; }
  50%      { transform: translateY(-14px) scale(1.22); opacity: 1.0; }
}

/* 2.0x Heroic Breakout Anchor overlapping cleanly across the curved silk S-wave divider without clipping top of head/staff! */
.tb-vb-hero-anchor {
  position: relative;
  z-index: 5;
  height: 104%;
  max-height: 600px;
  margin-bottom: -36px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  transform-origin: 50% 90%;
  overflow: visible;
}

.tb-vb-hero-img,
.tb-vb-hero-canvas {
  height: 100%;
  width: auto;
  max-width: min(680px, 84vw);
  object-fit: contain;
  display: block;
  pointer-events: none;
  filter: drop-shadow(0 14px 24px rgba(10, 12, 28, 0.55));
}

/* v1.0.3 Face-Safe Right-Shoulder Title Anchor: LEFT-anchored (`translate(0, -50%)`) strictly clear of hero's face/cheek
 * so long 2–3 word titles across all 9 languages ("Chapter Cleared!", "KAPITEL ABGESCHLOSSEN!", "ГЛАВА ПРОЙДЕНА!")
 * NEVER expand leftward over the hero's head or clip off the right viewport edge! */
.tb-vb-title-cluster {
  position: absolute;
  top: 27%;
  left: calc(50% + min(135px, 11.5vw));
  max-width: calc(50% - min(135px, 11.5vw) - 28px);
  transform: translate(0, -50%);
  z-index: 7;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  text-align: left;
  pointer-events: none;
}

.tb-vb-title-halo {
  position: absolute;
  left: min(14%, 44px);
  top: 50%;
  margin-top: -105px;
  width: 210px;
  height: 210px;
  pointer-events: none;
  animation: tbVbHaloSpin 18s linear infinite;
}

@keyframes tbVbHaloSpin {
  0%   { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.tb-vb-title-text {
  position: relative;
  margin: 0;
  max-width: 100%;
  font-size: clamp(44px, 5.4vw, 74px);
  font-weight: 900;
  letter-spacing: 0.04em;
  line-height: 1.06;
  white-space: normal;
  overflow-wrap: break-word;
  background: linear-gradient(180deg, #fffef5 0%, #ffe87c 44%, #eb9d1a 80%, #a55606 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 4px 0 #3d1a03) drop-shadow(0 8px 18px rgba(250, 204, 21, 0.52));
  animation: tbRubberPop 460ms cubic-bezier(0.08, 0.65, 0.75, 1.0) both;
}

.tb-vb-title-text[data-title-len="medium"] {
  font-size: clamp(34px, 4.1vw, 58px);
  letter-spacing: 0.03em;
}

.tb-vb-title-text[data-title-len="long"] {
  font-size: clamp(28px, 3.3vw, 48px);
  letter-spacing: 0.02em;
}

.tb-vb-title-text[data-title-len="xlong"] {
  font-size: clamp(24px, 2.7vw, 40px);
  letter-spacing: 0.015em;
}

.tb-victory-breakout[data-outcome="defeat"] .tb-vb-title-text {
  background: linear-gradient(180deg, #f8fafc 0%, #cbd5e1 48%, #64748b 86%, #334155 100%);
  -webkit-background-clip: text;
  background-clip: text;
  filter: drop-shadow(0 3px 0 #0f172a) drop-shadow(0 6px 12px rgba(148, 163, 184, 0.35));
}

/* Compact utility rail tucked beside the hero's right shoulder (matches ref_01, never stranded at 1920px far edge!) */
.tb-vb-utility-rail {
  position: absolute;
  left: calc(50% + min(310px, 31vw));
  bottom: 12%;
  z-index: 8;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tb-vb-util-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 1.5px solid rgba(226, 232, 240, 0.52);
  background: linear-gradient(180deg, rgba(71, 84, 128, 0.92) 0%, rgba(33, 41, 68, 0.95) 100%);
  color: #f8fafc;
  font-size: 11px;
  font-weight: 800;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

/* 3-Layer Lush Curved Silk-Cloud S-Wave Divider separating 55% Hero Stage & 45% Reward Deck */
.tb-vb-wave-divider {
  position: relative;
  width: 100%;
  height: 78px;
  margin-top: -54px;
  z-index: 6;
  pointer-events: none;
  flex-shrink: 0;
}

.tb-vb-wave-divider svg {
  width: 100%;
  height: 100%;
  display: block;
}

.tb-vb-deck {
  position: relative;
  flex: 1 1 46%;
  min-height: 0;
  z-index: 7;
  background: linear-gradient(180deg, #272e4c 0%, #2d3659 56%, #364065 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 4px clamp(16px, 4vw, 48px) clamp(16px, 2.5vh, 28px);
  gap: clamp(8px, 1.4vh, 14px);
}

.tb-vb-stage-ribbon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  min-width: min(460px, 84vw);
  padding: 6px 28px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(20, 24, 42, 0.15) 0%, rgba(16, 20, 36, 0.80) 20%, rgba(16, 20, 36, 0.80) 80%, rgba(20, 24, 42, 0.15) 100%);
  border: 1px solid rgba(250, 204, 21, 0.38);
  color: #fde68a;
  font-size: clamp(14px, 1.5vw, 18px);
  font-weight: 800;
  letter-spacing: 0.04em;
}

.tb-vb-ornament {
  width: 38px;
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, #f5c542, transparent);
}

.tb-vb-summary-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(22px, 4.5vw, 52px);
  width: 100%;
  max-width: 680px;
}

.tb-vb-duel-side {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 128px;
}

.tb-vb-avatar {
  width: 60px;
  height: 60px;
  border-radius: 12px;
  border: 2px solid #7dd3fc;
  object-fit: cover;
  object-position: center 15%;
  background: #172038;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

.tb-vb-side-name { font-size: 15px; font-weight: 800; color: #f8fafc; }
.tb-vb-side-score { font-size: 13px; font-weight: 700; color: #cbd5e1; }
.tb-vb-delta-pos { color: #4ade80; margin-left: 4px; }
.tb-vb-delta-neg { color: #f87171; margin-left: 4px; }

.tb-vb-vs-emblem {
  font-size: 32px;
  font-weight: 900;
  font-style: italic;
  background: linear-gradient(180deg, #fff6b8 0%, #f59e0b 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.45));
}

.tb-vb-rewards-box {
  position: relative;
  width: min(580px, 90vw);
  padding: 20px 22px 14px;
  border-radius: 16px;
  background: rgba(16, 20, 38, 0.38);
  border: 1px solid rgba(148, 163, 184, 0.28);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: nowrap;
}

.tb-vb-rewards-pill {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  padding: 2px 24px;
  border-radius: 999px;
  background: #232a46;
  border: 1px solid rgba(196, 210, 255, 0.40);
  font-size: 13px;
  font-weight: 800;
  color: #e2e8f0;
  white-space: nowrap;
}

.tb-vb-reward-tile {
  position: relative;
  width: 72px;
  height: 72px;
  border-radius: 14px;
  border: 2px solid #c084fc;
  background: radial-gradient(circle at 50% 35%, rgba(216, 180, 254, 0.44) 0%, rgba(59, 25, 92, 0.88) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.38);
}

.tb-vb-reward-tile[data-rarity="gold"],
.tb-vb-reward-tile[data-rarity="legendary"] {
  border-color: #facc15;
  background: radial-gradient(circle at 50% 35%, rgba(254, 240, 138, 0.44) 0%, rgba(120, 53, 15, 0.88) 100%);
}

.tb-vb-reward-tile[data-rarity="rare"],
.tb-vb-reward-tile[data-rarity="cyan"] {
  border-color: #38bdf8;
  background: radial-gradient(circle at 50% 35%, rgba(125, 211, 252, 0.42) 0%, rgba(12, 74, 110, 0.88) 100%);
}

.tb-vb-reward-icon { width: 54px; height: 54px; object-fit: contain; display: block; }
.tb-vb-reward-qty {
  position: absolute;
  right: 5px;
  bottom: 2px;
  font-size: 13px;
  font-weight: 900;
  color: #ffffff;
  text-shadow: 0 1px 3px #000, 0 0 4px #000;
}

.tb-vb-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(18px, 3vw, 36px);
  width: 100%;
  flex-wrap: nowrap;
}

.tb-vb-cta-pill {
  min-width: clamp(178px, 20vw, 248px);
  height: 50px;
  padding: 0 26px;
  border-radius: 999px;
  border: 2px solid #fef08a;
  background: linear-gradient(180deg, #ffec9e 0%, #eab038 52%, #b77714 100%);
  color: #ffffff;
  font-size: clamp(15px, 1.4vw, 18px);
  font-weight: 900;
  letter-spacing: 0.03em;
  text-shadow: 0 2px 3px rgba(66, 32, 6, 0.85);
  box-shadow: inset 0 2px 1px rgba(255, 255, 255, 0.58), 0 5px 14px rgba(0, 0, 0, 0.45);
  cursor: pointer;
  white-space: nowrap;
}

.tb-vb-cta-pill.tb-vb-cta-secondary {
  border-color: #fde68a;
  background: linear-gradient(180deg, #f3d27a 0%, #c89128 54%, #8f5c10 100%);
}

@media (prefers-reduced-motion: reduce) {
  .tb-vb-aura-glow,
  .tb-vb-aura-rune-svg,
  .tb-vb-spark-dot,
  .tb-vb-title-halo,
  .tb-vb-title-text {
    animation: none !important;
  }
}
