/* Polyh: Phone Rig — layout skeleton. Colours and sizes come from controls. */

.polyh-rig {
  position: relative;
  display: flex;
  justify-content: center;
  width: 100%;
  perspective: 1400px;
}

.polyh-rig__stage {
  position: relative;
  will-change: transform;
}

/* Sits behind a cut-out device to give it back the halo the plate used to
   carry. Centred on the stage and scaled relative to the device. */
.polyh-rig__glow {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}

.polyh-rig__img {
  position: relative;
  z-index: 1;
  display: block;
  max-width: 100%;
  height: auto;
  transform-style: preserve-3d;
  will-change: transform;
}

/* A rectangular glow-on-black render dissolves into the page instead of
   showing its plate edges. */
.polyh-rig-feather-yes .polyh-rig__img {
  -webkit-mask-image: radial-gradient(88% 84% at 50% 50%, #000 68%, rgba(0, 0, 0, 0) 100%);
  mask-image: radial-gradient(88% 84% at 50% 50%, #000 68%, rgba(0, 0, 0, 0) 100%);
}

.polyh-rig-drift-yes .polyh-rig__img {
  animation: polyh-rig-drift 9s ease-in-out infinite;
}

@keyframes polyh-rig-drift {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  50%  { transform: translate3d(0, -14px, 0) scale(1.015); }
  100% { transform: translate3d(0, 0, 0) scale(1); }
}

/* While the cursor is driving the tilt the JS owns the transform, so the
   idle drift is suspended to avoid the two fighting. */
.polyh-rig-drift-yes .polyh-rig__img.is-tilting {
  animation: none;
}

/* ---- Chips ---- */
.polyh-chip {
  position: absolute;
  z-index: 20;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, .1);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  will-change: transform;
}

.polyh-chip--tl { left: -6%; top: 14%; }
.polyh-chip--tr { right: -8%; top: 30%; }
.polyh-chip--bl { left: -2%; bottom: 16%; }
.polyh-chip--br { right: -4%; bottom: 22%; }

.polyh-chip__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.polyh-chip__bot {
  margin-top: 8px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
}

.polyh-chip__match {
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
}

.polyh-chip__market {
  font-size: 11px;
  line-height: 1.4;
}

.polyh-chip__odds {
  font-size: 18px;
  font-weight: 600;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.polyh-chip__dot {
  position: relative;
  display: inline-block;
  height: 6px;
  width: 6px;
  flex: 0 0 auto;
  border-radius: 999px;
}

.polyh-chip__dot::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: inherit;
  animation: polyh-rig-pulse 2s cubic-bezier(.16, 1, .3, 1) infinite;
}

@keyframes polyh-rig-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(47, 211, 122, .5); }
  50%      { box-shadow: 0 0 0 6px rgba(47, 211, 122, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .polyh-rig-drift-yes .polyh-rig__img { animation: none !important; }
  .polyh-chip__dot::before { animation: none !important; }
}
