/* ===== Genshin x Honkai: Star Rail Game HUD System (v12.0) ===== */

@keyframes hsrSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes goldShimmer {
  0% { background-position: -140% 0; }
  100% { background-position: 220% 0; }
}

@keyframes tourFloatArrow {
  0%, 100% { transform: translateY(0px) scale(1); }
  50% { transform: translateY(-7px) scale(1.06); }
}

/* Fullscreen Three.js 3D Stage Canvas */
#world3dCanvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  display: block;
  z-index: 1;
}
#stageCanvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  display: block;
  z-index: 2;
  pointer-events: none;
}

/* Soft edge cinema vignettes so HUD text pops effortlessly without dark bottom bands */
.viewport::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(6, 11, 24, 0.34) 0%, transparent 15%, transparent 90%, rgba(6, 11, 24, 0.12) 100%);
}

/* 1. Top-Left Genshin/HSR Borderless Quest Strip */
.hud-top-left {
  top: 12px !important;
  left: 16px !important;
  z-index: 26 !important;
}
.mission-crest-wrap {
  width: 54px !important;
  height: 54px !important;
  background: radial-gradient(circle at 32% 28%, #2a4572 0%, #0d162c 76%) !important;
  border: 2px solid rgba(255, 232, 163, 0.92) !important;
  box-shadow: 0 0 22px rgba(77, 232, 255, 0.35), 0 6px 18px rgba(0, 0, 0, 0.52) !important;
}
.mission-card {
  margin-left: -18px !important;
  padding: 9px 32px 9px 28px !important;
  border-radius: 0 !important;
  border: none !important;
  border-top: 1px solid rgba(243, 207, 118, 0.45) !important;
  border-bottom: 1px solid rgba(243, 207, 118, 0.32) !important;
  background: linear-gradient(90deg, rgba(10, 17, 34, 0.88) 0%, rgba(12, 21, 42, 0.72) 68%, rgba(12, 21, 42, 0) 100%) !important;
  box-shadow: none !important;
  backdrop-filter: blur(8px) !important;
  -webkit-mask-image: linear-gradient(90deg, #000 0%, #000 84%, transparent 100%);
  mask-image: linear-gradient(90deg, #000 0%, #000 84%, transparent 100%);
  max-width: 390px !important;
}
.mc-diamond {
  background: linear-gradient(135deg, #fff5d0, #e6a93c) !important;
  box-shadow: 0 0 10px rgba(255, 232, 163, 0.95) !important;
}
.mc-star {
  background: rgba(243, 207, 118, 0.14) !important;
  border-color: rgba(243, 207, 118, 0.45) !important;
  clip-path: polygon(6px 0, 100% 0, calc(100% - 6px) 100%, 0 100%);
  border-radius: 0 !important;
  padding: 2px 10px !important;
}

/* 2. Astral Observatory & Chamfered Popovers */
.popover-panel {
  border-radius: 0 !important;
  clip-path: polygon(16px 0, 100% 0, 100% calc(100% - 16px), calc(100% - 16px) 100%, 0 100%, 0 16px);
  background: linear-gradient(155deg, rgba(13, 22, 44, 0.90) 0%, rgba(7, 13, 27, 0.94) 100%) !important;
  border: 1px solid rgba(243, 207, 118, 0.52) !important;
  box-shadow: inset 0 0 24px rgba(77, 232, 255, 0.08), 0 22px 54px rgba(0, 0, 0, 0.62) !important;
}
.popover-panel::before {
  display: none !important;
}
#eyePopover {
  overflow: hidden;
}
.hsr-astrolabe-bg {
  position: absolute;
  right: -74px;
  bottom: -74px;
  width: 240px;
  height: 240px;
  opacity: 0.07;
  pointer-events: none;
  z-index: 0;
  animation: hsrSpin 48s linear infinite;
}
.hsr-filigree {
  position: absolute;
  inset: 5px;
  pointer-events: none;
  z-index: 4;
}
.hsr-filigree span {
  position: absolute;
  width: 14px;
  height: 14px;
  border-color: rgba(255, 232, 163, 0.72);
  border-style: solid;
}
.hsr-filigree .c-tl { top: 0; left: 0; border-width: 2px 0 0 2px; }
.hsr-filigree .c-tr { top: 0; right: 0; border-width: 2px 2px 0 0; }
.hsr-filigree .c-bl { bottom: 0; left: 0; border-width: 0 0 2px 2px; }
.hsr-filigree .c-br { bottom: 0; right: 0; border-width: 0 2px 2px 0; }

.pop-ctrl-btn {
  border-radius: 4px !important;
  clip-path: polygon(5px 0, 100% 0, calc(100% - 5px) 100%, 0 100%);
  padding: 3px 10px !important;
}

/* 3. Top-Right Circular Emblem Buttons with Kinetic Gold Glow + Env Mode Switcher */
.env-mode-pill {
  height: 36px;
  margin-top: 5px;
  padding: 0 14px 0 11px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  color: #eef6ff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.3px;
  background: linear-gradient(135deg, rgba(16, 28, 54, 0.92), rgba(10, 17, 34, 0.88));
  border: 1.5px solid rgba(77, 232, 255, 0.56);
  clip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45), inset 0 0 12px rgba(77, 232, 255, 0.14);
  transition: all 0.18s ease;
  white-space: nowrap;
}
.env-mode-pill:hover {
  transform: translateY(-1px);
  border-color: #ffe8a3;
  box-shadow: 0 8px 22px rgba(77, 232, 255, 0.34);
}
.env-mode-pill.atlas-active {
  background: linear-gradient(135deg, rgba(58, 42, 16, 0.94), rgba(22, 18, 12, 0.92));
  border-color: rgba(255, 232, 163, 0.92);
  color: #ffe8a3;
  box-shadow: 0 0 18px rgba(243, 207, 118, 0.48), inset 0 0 12px rgba(255, 232, 163, 0.22);
}
.emp-dot {
  width: 8px;
  height: 8px;
  transform: rotate(45deg);
  background: #4de8ff;
  box-shadow: 0 0 8px rgba(77, 232, 255, 0.95);
  flex-shrink: 0;
}
.env-mode-pill.atlas-active .emp-dot {
  background: #ffe8a3;
  box-shadow: 0 0 10px rgba(255, 232, 163, 0.98);
}

.circle-icon-btn::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1px dashed rgba(243, 207, 118, 0.28);
  pointer-events: none;
  transition: transform 0.35s ease, border-color 0.2s;
}
.circle-icon-btn:hover::after {
  transform: rotate(35deg) scale(1.04);
  border-color: rgba(255, 232, 163, 0.78);
}

/* 4. Borderless Bottom-Center HSR Star-Rail Timeline (Zero Redundant Title Box!) */
.timeline-dock {
  background: linear-gradient(180deg, rgba(10, 18, 36, 0) 0%, rgba(10, 18, 36, 0.78) 38%, rgba(8, 14, 28, 0.90) 100%) !important;
  border: none !important;
  border-top: 1px solid rgba(243, 207, 118, 0.32) !important;
  border-radius: 0 !important;
  clip-path: polygon(16px 0, calc(100% - 16px) 0, 100% 100%, 0 100%);
  padding: 7px 22px 8px !important;
  box-shadow: none !important;
}
.tl-head {
  justify-content: flex-end !important;
  margin-bottom: 2px !important;
}
.tl-title {
  display: none !important;
}
.tl-time-readout {
  font-size: 11px !important;
  font-weight: 800;
  color: #ffe8a3 !important;
  letter-spacing: 0.4px;
}
.diamond-node {
  border-radius: 2px !important;
  clip-path: polygon(6px 0, 100% 0, calc(100% - 6px) 100%, 0 100%);
  padding: 3px 12px !important;
}

/* 5. Bottom-Left Overwatch-Style 180px Breakout Ella Bar + Inline Tour Controls */
.subtitle-bar {
  position: relative !important;
  overflow: visible !important;
  clip-path: none !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  flex: 0 1 486px !important;
  min-width: 340px !important;
  min-height: 82px !important;
  padding: 12px 18px 12px 162px !important;
  transition: transform 0.2s, filter 0.2s;
}
.subtitle-bar::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 100%, 0 100%);
  background: linear-gradient(95deg, rgba(10, 17, 34, 0.94) 0%, rgba(13, 22, 42, 0.86) 78%, rgba(13, 22, 42, 0.44) 100%);
  border-top: 1.5px solid rgba(243, 207, 118, 0.68);
  border-bottom: 1px solid rgba(77, 232, 255, 0.25);
  backdrop-filter: blur(12px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.48);
}
.subtitle-bar.tour-active {
  z-index: 65 !important;
}
.subtitle-bar.tour-active::before {
  border-top-color: #ffe8a3;
  box-shadow: 0 0 28px rgba(243, 207, 118, 0.46), 0 14px 36px rgba(0, 0, 0, 0.68);
}
.sub-content {
  position: relative;
  z-index: 4;
}
.ella-ow-plate {
  position: absolute;
  left: 12px;
  bottom: 0;
  width: 118px;
  height: 114px;
  z-index: 2;
  pointer-events: none;
  transform: skewX(-12deg);
  transform-origin: bottom left;
  background: linear-gradient(155deg, rgba(77, 232, 255, 0.34) 0%, rgba(243, 207, 118, 0.32) 48%, rgba(12, 22, 44, 0.85) 100%);
  border: 1.5px solid rgba(255, 232, 163, 0.72);
  box-shadow: 0 0 22px rgba(77, 232, 255, 0.36), inset 0 0 16px rgba(255, 232, 163, 0.22);
}
.ella-bust-pop {
  position: absolute !important;
  left: -14px !important;
  bottom: -4px !important;
  height: 180px !important;
  width: auto !important;
  z-index: 6 !important;
  pointer-events: none;
  filter: drop-shadow(0 0 14px rgba(77, 232, 255, 0.42)) drop-shadow(0 6px 18px rgba(0, 0, 0, 0.72)) !important;
}
.tour-inline-actions {
  display: none;
  align-items: center;
  gap: 8px;
  margin-top: 7px;
}
.subtitle-bar.tour-active .tour-inline-actions {
  display: flex;
}
.tour-step-tag {
  font-size: 10.5px;
  font-weight: 800;
  color: var(--gold-bright);
  padding: 2px 8px;
  background: rgba(243, 207, 118, 0.16);
  border: 1px solid rgba(243, 207, 118, 0.42);
  clip-path: polygon(5px 0, 100% 0, calc(100% - 5px) 100%, 0 100%);
}
.tour-btn-skip {
  margin-left: auto;
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #cbd9f2;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  clip-path: polygon(5px 0, 100% 0, calc(100% - 5px) 100%, 0 100%);
}
.tour-btn-next {
  padding: 4px 14px;
  border: 1px solid #fff3cf;
  background: linear-gradient(110deg, #ffe8a3 0%, #df9e34 55%, #ffe8a3 100%);
  background-size: 200% 100%;
  animation: goldShimmer 2.6s linear infinite;
  color: #1f1404;
  font-size: 11.5px;
  font-weight: 800;
  cursor: pointer;
  clip-path: polygon(5px 0, 100% 0, calc(100% - 5px) 100%, 0 100%);
}

/* Floating In-World Gold Pointer Arrow during Tour */
.tour-world-arrow {
  position: fixed;
  z-index: 66;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  filter: drop-shadow(0 0 12px rgba(255, 232, 163, 0.92));
  animation: tourFloatArrow 1.15s ease-in-out infinite;
}
.tour-world-arrow .twa-tag {
  padding: 2px 9px;
  background: rgba(12, 20, 38, 0.94);
  border: 1px solid rgba(255, 232, 163, 0.85);
  color: #ffe8a3;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
  clip-path: polygon(5px 0, 100% 0, calc(100% - 5px) 100%, 0 100%);
}

/* 6. Genshin x HSR Full-Width Domain Cleared Ceremonial Banner (Zero Boxy Modal!) */
.victory-modal {
  inset: 0 !important;
  left: 0 !important;
  top: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  transform: none !important;
  border-radius: 0 !important;
  border: none !important;
  padding: 0 !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 50%, rgba(12, 20, 40, 0.62) 0%, rgba(5, 9, 18, 0.86) 100%) !important;
  backdrop-filter: blur(8px) !important;
  box-shadow: none !important;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease !important;
}
.victory-modal.show {
  opacity: 1 !important;
  pointer-events: auto !important;
}
.victory-astrolabe-halo {
  position: absolute;
  width: 340px;
  height: 340px;
  opacity: 0.22;
  pointer-events: none;
  animation: hsrSpin 28s linear infinite;
}
.victory-banner-ribbon {
  position: relative;
  width: 100vw;
  padding: 28px 24px 30px;
  text-align: center;
  background: linear-gradient(90deg, transparent 0%, rgba(12, 20, 42, 0.88) 18%, rgba(20, 32, 64, 0.96) 50%, rgba(12, 20, 42, 0.88) 82%, transparent 100%);
  transform: scaleY(0.88);
  transition: transform 0.34s cubic-bezier(0.22, 1, 0.36, 1);
}
.victory-modal.show .victory-banner-ribbon {
  transform: scaleY(1);
}
.victory-banner-ribbon::before,
.victory-banner-ribbon::after {
  content: "";
  position: absolute;
  left: 10%;
  right: 10%;
  height: 1.5px;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 232, 163, 0.85) 35%, #ffffff 50%, rgba(255, 232, 163, 0.85) 65%, transparent 100%);
}
.victory-banner-ribbon::before { top: 0; }
.victory-banner-ribbon::after { bottom: 0; }

.victory-law-pill {
  border-radius: 0 !important;
  clip-path: polygon(10px 0, 100% 0, calc(100% - 10px) 100%, 0 100%);
  padding: 6px 26px !important;
}
.v-btn-gold {
  border-radius: 0 !important;
  clip-path: polygon(10px 0, 100% 0, calc(100% - 10px) 100%, 0 100%);
  background: linear-gradient(110deg, #ffe8a3 0%, #df9e34 55%, #ffe8a3 100%) !important;
  background-size: 200% 100%;
  animation: goldShimmer 2.8s linear infinite;
}
.v-btn-ghost {
  border-radius: 0 !important;
  clip-path: polygon(10px 0, 100% 0, calc(100% - 10px) 100%, 0 100%);
}
