/* Game HUD Frame — experimental
   Namespace: .gsp-game-hud-*
   Mobile shell overlay only. Desktop/wide: root gets .is-desktop-hidden
*/
.gsp-game-hud-shell {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  background: #000;
  overflow: hidden;
}
.gsp-game-hud-shell iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: #000;
}

.gsp-game-hud {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}
.gsp-game-hud.is-desktop-hidden,
.gsp-game-hud[hidden] {
  display: none !important;
}

.gsp-game-hud-corner {
  position: absolute;
  width: 120px;
  height: 120px;
  z-index: 2;
  overflow: visible;
  pointer-events: none;
}
.gsp-game-hud-corner .gsp-game-hud-wash {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.gsp-game-hud-corner.is-tl .gsp-game-hud-wash {
  background:
    radial-gradient(ellipse 80% 80% at 10% 10%, rgba(255, 230, 80, 0.28), transparent 55%),
    radial-gradient(ellipse 85% 85% at 0% 0%, rgba(255, 40, 30, 0.38), transparent 64%),
    linear-gradient(135deg, rgba(100, 0, 0, 0.35) 0%, transparent 68%);
}
.gsp-game-hud-corner.is-tr .gsp-game-hud-wash {
  background:
    radial-gradient(ellipse 80% 80% at 90% 10%, rgba(255, 230, 80, 0.28), transparent 55%),
    radial-gradient(ellipse 85% 85% at 100% 0%, rgba(255, 40, 30, 0.38), transparent 64%),
    linear-gradient(225deg, rgba(100, 0, 0, 0.35) 0%, transparent 68%);
}
.gsp-game-hud-corner.is-bl .gsp-game-hud-wash {
  background:
    radial-gradient(ellipse 80% 80% at 10% 90%, rgba(255, 230, 80, 0.28), transparent 55%),
    radial-gradient(ellipse 85% 85% at 0% 100%, rgba(255, 40, 30, 0.38), transparent 64%),
    linear-gradient(45deg, rgba(100, 0, 0, 0.35) 0%, transparent 68%);
}
.gsp-game-hud-corner.is-br .gsp-game-hud-wash {
  background:
    radial-gradient(ellipse 80% 80% at 90% 90%, rgba(255, 230, 80, 0.28), transparent 55%),
    radial-gradient(ellipse 85% 85% at 100% 100%, rgba(255, 40, 30, 0.38), transparent 64%),
    linear-gradient(315deg, rgba(100, 0, 0, 0.35) 0%, transparent 68%);
}

.gsp-game-hud-arm-h,
.gsp-game-hud-arm-v {
  position: absolute;
  border-radius: 2px;
  box-shadow: 0 0 12px rgba(255, 40, 40, 0.75);
}
.gsp-game-hud-arm-h {
  height: 3px;
  width: 72px;
  background: linear-gradient(90deg, #ff4a3a, #ff1a1a 45%, transparent);
}
.gsp-game-hud-arm-v {
  width: 3px;
  height: 72px;
  background: linear-gradient(180deg, #ff4a3a, #ff1a1a 45%, transparent);
}
.gsp-game-hud-joint {
  position: absolute;
  width: 11px;
  height: 11px;
  border: 2px solid #ff3b2f;
  border-radius: 2px;
  background: rgba(255, 40, 40, 0.3);
  box-shadow: 0 0 14px rgba(255, 40, 40, 0.9), 0 0 10px rgba(255, 220, 80, 0.55);
  z-index: 3;
}
.gsp-game-hud-tick {
  position: absolute;
  width: 10px;
  height: 2px;
  background: #ffd24a;
  box-shadow: 0 0 10px rgba(255, 210, 74, 0.85);
  opacity: 0.9;
  z-index: 2;
}
.gsp-game-hud-light {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff5c8;
  box-shadow: 0 0 12px #ffd24a, 0 0 20px #ff3b2f;
  opacity: 0.95;
  z-index: 4;
}

.gsp-game-hud-volt {
  position: absolute;
  width: 78px;
  height: 78px;
  z-index: 2;
  overflow: visible;
  filter: drop-shadow(0 0 4px #ffe566) drop-shadow(0 0 10px rgba(255, 180, 0, 0.75));
}
.gsp-game-hud-volt svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}
.gsp-game-hud-volt .gsp-game-hud-core {
  fill: none;
  stroke: #fffde8;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 10 6 4 8 6 5;
  animation: gspGameHudVoltFlow 0.55s linear infinite;
}
.gsp-game-hud-volt .gsp-game-hud-arc {
  fill: none;
  stroke: #ffe033;
  stroke-width: 1.35;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.95;
  animation: gspGameHudVoltCrack 0.35s steps(2) infinite;
}
.gsp-game-hud-volt .gsp-game-hud-arc.is-soft {
  stroke: #ffb000;
  stroke-width: 2.4;
  opacity: 0.45;
  filter: blur(0.6px);
  animation-duration: 0.48s;
}
.gsp-game-hud-volt .gsp-game-hud-branch {
  fill: none;
  stroke: #fff6a0;
  stroke-width: 1.1;
  stroke-linecap: round;
  opacity: 0;
  animation: gspGameHudBranchFlash 1.1s ease-in-out infinite;
}
.gsp-game-hud-corner.is-tr .gsp-game-hud-branch { animation-delay: 0.25s; }
.gsp-game-hud-corner.is-bl .gsp-game-hud-branch { animation-delay: 0.55s; }
.gsp-game-hud-corner.is-br .gsp-game-hud-branch { animation-delay: 0.8s; }

.gsp-game-hud-corner.is-tl { top: 6px; left: 6px; animation: gspGameHudBreathTL 5s ease-in-out infinite; }
.gsp-game-hud-corner.is-tr { top: 6px; right: 6px; animation: gspGameHudBreathTR 5.4s ease-in-out infinite; }
.gsp-game-hud-corner.is-bl { bottom: 6px; left: 6px; animation: gspGameHudBreathBL 5.8s ease-in-out infinite; }
.gsp-game-hud-corner.is-br { bottom: 6px; right: 6px; animation: gspGameHudBreathBR 4.8s ease-in-out infinite; }

.gsp-game-hud-corner.is-tl .gsp-game-hud-arm-h { top: 0; left: 0; }
.gsp-game-hud-corner.is-tl .gsp-game-hud-arm-v { top: 0; left: 0; }
.gsp-game-hud-corner.is-tl .gsp-game-hud-joint { top: -4px; left: -4px; }
.gsp-game-hud-corner.is-tl .gsp-game-hud-tick { top: 16px; left: 20px; animation: gspGameHudTickH 2.6s ease-in-out infinite; }
.gsp-game-hud-corner.is-tl .gsp-game-hud-light { top: 0; left: 0; margin-top: -2px; margin-left: -2px; animation: gspGameHudLightTL 2.8s linear infinite; }
.gsp-game-hud-corner.is-tl .gsp-game-hud-volt { top: -2px; left: -2px; }

.gsp-game-hud-corner.is-tr .gsp-game-hud-arm-h { top: 0; right: 0; background: linear-gradient(270deg, #ff4a3a, #ff1a1a 45%, transparent); }
.gsp-game-hud-corner.is-tr .gsp-game-hud-arm-v { top: 0; right: 0; }
.gsp-game-hud-corner.is-tr .gsp-game-hud-joint { top: -4px; right: -4px; }
.gsp-game-hud-corner.is-tr .gsp-game-hud-tick { top: 16px; right: 20px; animation: gspGameHudTickH 2.9s ease-in-out infinite reverse; }
.gsp-game-hud-corner.is-tr .gsp-game-hud-light { top: 0; right: 0; margin-top: -2px; margin-right: -2px; animation: gspGameHudLightTR 3.1s linear infinite; }
.gsp-game-hud-corner.is-tr .gsp-game-hud-volt { top: -2px; right: -2px; transform: scaleX(-1); }

.gsp-game-hud-corner.is-bl .gsp-game-hud-arm-h { bottom: 0; left: 0; }
.gsp-game-hud-corner.is-bl .gsp-game-hud-arm-v { bottom: 0; left: 0; background: linear-gradient(0deg, #ff4a3a, #ff1a1a 45%, transparent); }
.gsp-game-hud-corner.is-bl .gsp-game-hud-joint { bottom: -4px; left: -4px; }
.gsp-game-hud-corner.is-bl .gsp-game-hud-tick { bottom: 16px; left: 20px; animation: gspGameHudTickH 3s ease-in-out infinite; }
.gsp-game-hud-corner.is-bl .gsp-game-hud-light { bottom: 0; left: 0; margin-bottom: -2px; margin-left: -2px; animation: gspGameHudLightBL 3.3s linear infinite; }
.gsp-game-hud-corner.is-bl .gsp-game-hud-volt { bottom: -2px; left: -2px; transform: scaleY(-1); }

.gsp-game-hud-corner.is-br .gsp-game-hud-arm-h { bottom: 0; right: 0; background: linear-gradient(270deg, #ff4a3a, #ff1a1a 45%, transparent); }
.gsp-game-hud-corner.is-br .gsp-game-hud-arm-v { bottom: 0; right: 0; background: linear-gradient(0deg, #ff4a3a, #ff1a1a 45%, transparent); }
.gsp-game-hud-corner.is-br .gsp-game-hud-joint { bottom: -4px; right: -4px; }
.gsp-game-hud-corner.is-br .gsp-game-hud-tick { bottom: 16px; right: 20px; animation: gspGameHudTickH 2.4s ease-in-out infinite reverse; }
.gsp-game-hud-corner.is-br .gsp-game-hud-light { bottom: 0; right: 0; margin-bottom: -2px; margin-right: -2px; animation: gspGameHudLightBR 2.7s linear infinite; }
.gsp-game-hud-corner.is-br .gsp-game-hud-volt { bottom: -2px; right: -2px; transform: scale(-1); }

/* RTP oval */
.gsp-game-hud-rtp {
  position: absolute;
  top: 14px;
  left: 96px;
  right: 96px;
  z-index: 3;
  pointer-events: none;
}
.gsp-game-hud-rtp-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  font-size: 10px;
  letter-spacing: 0.1em;
  color: #ffe6a8;
  margin-bottom: 6px;
  text-transform: uppercase;
  text-shadow: 0 1px 0 #4a2800, 0 0 10px rgba(255, 180, 40, 0.35);
}
.gsp-game-hud-rtp-label b {
  font-size: 14px;
  color: #fff8dc;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 12px rgba(255, 210, 80, 0.7);
}
.gsp-game-hud-rtp-track {
  height: 16px;
  border-radius: 999px;
  background: rgba(10, 4, 2, 0.72);
  border: 1px solid rgba(255, 180, 80, 0.45);
  box-shadow: 0 0 14px rgba(255, 80, 40, 0.25), inset 0 0 10px rgba(0, 0, 0, 0.65);
  overflow: hidden;
  position: relative;
}
.gsp-game-hud-rtp-fill {
  position: relative;
  height: 100%;
  width: 58%;
  border-radius: 999px;
  background: linear-gradient(90deg, #1a6cff, #4ecbff 45%, #9ae8ff);
  box-shadow:
    0 0 16px rgba(80, 180, 255, 0.85),
    0 0 28px rgba(40, 120, 255, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.55);
  transition: background 0.9s ease, box-shadow 0.9s ease;
  will-change: width;
  animation: gspGameHudOvalGlowBlue 2.4s ease-in-out infinite;
}
.gsp-game-hud-rtp-fill::before {
  content: "";
  position: absolute;
  top: 2px;
  left: 10px;
  right: 10px;
  height: 40%;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255,255,255,0.55), transparent);
  pointer-events: none;
}
.gsp-game-hud-rtp-fill::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.35) 50%, transparent 100%);
  background-size: 220% 100%;
  animation: gspGameHudOvalShine 2.8s linear infinite;
  pointer-events: none;
}
.gsp-game-hud-rtp-fill.is-warm {
  background: linear-gradient(90deg, #ff8a1a, #ffd24a 55%, #ffe9a0);
  box-shadow:
    0 0 18px rgba(255, 170, 40, 0.95),
    0 0 32px rgba(255, 100, 20, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
  animation: gspGameHudOvalGlowWarm 1.8s ease-in-out infinite;
}
.gsp-game-hud-rtp-fill.is-hot {
  background: linear-gradient(90deg, #ff1a1a, #ff7a2a 40%, #ffd24a 75%, #ff3b2f);
  box-shadow:
    0 0 22px rgba(255, 40, 20, 1),
    0 0 40px rgba(255, 80, 0, 0.65),
    inset 0 1px 0 rgba(255, 255, 255, 0.55);
  animation: gspGameHudOvalGlowHot 0.7s ease-in-out infinite;
}

@keyframes gspGameHudVoltFlow {
  0% { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: -40; }
}
@keyframes gspGameHudVoltCrack {
  0% { opacity: 0.55; }
  50% { opacity: 1; }
  100% { opacity: 0.7; }
}
@keyframes gspGameHudBranchFlash {
  0%, 55%, 100% { opacity: 0; }
  60% { opacity: 1; }
  68% { opacity: 0.2; }
  74% { opacity: 0.95; }
  82% { opacity: 0; }
}
@keyframes gspGameHudTickH {
  0%, 100% { opacity: 0.35; transform: translateX(0); }
  50% { opacity: 1; transform: translateX(12px); }
}
@keyframes gspGameHudLightTL {
  0% { transform: translate(0, 0); opacity: 0.3; }
  40% { transform: translate(52px, 0); opacity: 1; }
  50% { transform: translate(52px, 0); opacity: 0.2; }
  90% { transform: translate(0, 52px); opacity: 1; }
  100% { transform: translate(0, 0); opacity: 0.3; }
}
@keyframes gspGameHudLightTR {
  0% { transform: translate(0, 0); opacity: 0.3; }
  40% { transform: translate(-52px, 0); opacity: 1; }
  50% { transform: translate(-52px, 0); opacity: 0.2; }
  90% { transform: translate(0, 52px); opacity: 1; }
  100% { transform: translate(0, 0); opacity: 0.3; }
}
@keyframes gspGameHudLightBL {
  0% { transform: translate(0, 0); opacity: 0.3; }
  40% { transform: translate(52px, 0); opacity: 1; }
  50% { transform: translate(52px, 0); opacity: 0.2; }
  90% { transform: translate(0, -52px); opacity: 1; }
  100% { transform: translate(0, 0); opacity: 0.3; }
}
@keyframes gspGameHudLightBR {
  0% { transform: translate(0, 0); opacity: 0.3; }
  40% { transform: translate(-52px, 0); opacity: 1; }
  50% { transform: translate(-52px, 0); opacity: 0.2; }
  90% { transform: translate(0, -52px); opacity: 1; }
  100% { transform: translate(0, 0); opacity: 0.3; }
}
@keyframes gspGameHudBreathTL {
  0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.9; }
  50% { transform: translate(2px, 2px) scale(1.03); opacity: 1; }
}
@keyframes gspGameHudBreathTR {
  0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.9; }
  50% { transform: translate(-2px, 2px) scale(1.03); opacity: 1; }
}
@keyframes gspGameHudBreathBL {
  0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.9; }
  50% { transform: translate(3px, -2px) scale(1.04); opacity: 1; }
}
@keyframes gspGameHudBreathBR {
  0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.9; }
  50% { transform: translate(-2px, -2px) scale(1.03); opacity: 1; }
}
@keyframes gspGameHudOvalShine {
  0% { background-position: 120% 0; }
  100% { background-position: -120% 0; }
}
@keyframes gspGameHudOvalGlowBlue {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.18); }
}
@keyframes gspGameHudOvalGlowWarm {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.22); }
}
@keyframes gspGameHudOvalGlowHot {
  0%, 100% { filter: brightness(1) saturate(1); }
  50% { filter: brightness(1.4) saturate(1.25); }
}

/* Demo stage when ?src= missing (avoid blank black) */
.gsp-game-hud-demo {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    radial-gradient(circle at 50% 20%, rgba(255,180,60,0.15), transparent 50%),
    linear-gradient(180deg, #5a2214 0%, #2a0e08 55%, #1a0805 100%);
  color: #fff;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}
.gsp-game-hud-demo-inner {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 72px 24px 64px;
  text-align: center;
}
.gsp-game-hud-demo-ways {
  font-size: 18px;
  font-weight: 800;
  color: #ffe9a8;
  letter-spacing: 0.08em;
  margin-bottom: 18px;
  text-shadow: 0 2px 0 #5a3000;
}
.gsp-game-hud-demo-grid {
  width: min(280px, 80vw);
  height: 220px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  grid-template-rows: repeat(4, 1fr);
  gap: 6px;
  margin-bottom: 22px;
}
.gsp-game-hud-demo-tile {
  border-radius: 8px;
  background: linear-gradient(180deg, #f6f1e4, #d9d0bc);
  border: 1px solid rgba(0,0,0,0.2);
}
.gsp-game-hud-demo-tile.is-glow {
  background: linear-gradient(180deg, #fff8d0, #f0d878);
  box-shadow: 0 0 14px rgba(255,210,60,0.85);
}
.gsp-game-hud-demo-msg {
  font-size: 18px;
  font-weight: 800;
  color: #ffd24a;
  margin-bottom: 8px;
}
.gsp-game-hud-demo-sub {
  font-size: 12px;
  color: #ccc;
  line-height: 1.5;
}
.gsp-game-hud-demo-sub code {
  color: #9ad4ff;
  font-size: 11px;
}
