/* WIDGET-native games tray and short real-bird video rewards. */
.sol-play-shelf .companion-game-btn {
  min-width: 0;
  min-height: 72px;
  color: #352c23 !important;
  border-color: rgba(214, 172, 83, 0.74) !important;
  background: linear-gradient(155deg, #fffaf0, #efe3ca) !important;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.82),
    0 4px 12px rgba(0, 0, 0, 0.24) !important;
}

.sol-play-shelf .companion-game-btn .btn-icon-slot {
  width: 42px;
  height: 42px;
  border: 1px solid rgba(177, 132, 52, 0.52);
  border-radius: 12px;
  overflow: hidden;
  background: #f8f0de;
}

.sol-play-shelf .companion-game-btn .btn-icon-slot img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sol-play-shelf .companion-game-btn:active,
.sol-play-shelf .companion-game-btn:focus-visible {
  border-color: #79d5b0 !important;
  background: linear-gradient(155deg, #f4fff8, #caebdc) !important;
}

.companion-game-reward-overlay {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding:
    max(82px, calc(env(safe-area-inset-top) + 68px))
    max(10px, env(safe-area-inset-right))
    max(98px, calc(env(safe-area-inset-bottom) + 84px))
    max(10px, env(safe-area-inset-left));
  pointer-events: none;
  background: rgba(3, 12, 19, 0.2);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  animation: companionRewardIn 220ms ease both;
}

.companion-game-reward-frame {
  position: relative;
  width: min(76vw, 620px);
  max-height: calc(100dvh - 190px);
  aspect-ratio: 1;
  overflow: hidden;
  pointer-events: auto;
  border: 2px solid rgba(239, 203, 119, 0.86);
  border-radius: clamp(22px, 4vw, 34px);
  background:
    radial-gradient(circle at 50% 42%, rgba(122, 236, 191, 0.38), transparent 44%),
    linear-gradient(155deg, #173f38, #06131d);
  box-shadow:
    0 28px 74px rgba(0, 0, 0, 0.58),
    0 0 0 7px rgba(255, 250, 237, 0.12);
}

.companion-game-reward-video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #07151e;
}

.companion-game-reward-shade {
  position: absolute;
  inset: auto 0 0;
  height: 42%;
  pointer-events: none;
  background: linear-gradient(transparent, rgba(2, 10, 15, 0.92));
}

.companion-game-reward-copy {
  position: absolute;
  inset: auto 18px 18px;
  display: grid;
  gap: 3px;
  color: #fffdf7;
  text-shadow: 0 2px 8px #000;
}

.companion-game-reward-copy strong {
  font: 800 clamp(24px, 5vw, 42px)/1 "Fredoka", "Space Grotesk", system-ui, sans-serif;
}

.companion-game-reward-copy span {
  max-width: 32ch;
  font: 700 clamp(12px, 2vw, 16px)/1.25 "Space Grotesk", system-ui, sans-serif;
}

.companion-game-reward-close,
.companion-game-reward-sound,
.companion-game-reward-play {
  min-width: 48px;
  min-height: 48px;
  border: 1px solid rgba(255, 255, 255, 0.56);
  border-radius: 15px;
  color: #fff;
  background: rgba(4, 15, 22, 0.82);
  font: 800 12px/1 "Space Grotesk", system-ui, sans-serif;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.companion-game-reward-close {
  position: absolute;
  top: 12px;
  right: 12px;
}

.companion-game-reward-sound {
  position: absolute;
  top: 12px;
  left: 12px;
}

.companion-game-reward-sound.is-on {
  color: #113c2e;
  border-color: #92e7c2;
  background: #dff9ed;
}

.companion-game-reward-play {
  position: absolute;
  left: 50%;
  top: 50%;
  min-width: 142px;
  transform: translate(-50%, -50%);
  border-color: rgba(146, 231, 194, 0.86);
  background: rgba(9, 52, 41, 0.9);
}

.companion-game-reward-close:focus-visible,
.companion-game-reward-sound:focus-visible,
.companion-game-reward-play:focus-visible {
  outline: 3px solid #a7f4d3;
  outline-offset: 3px;
}

.companion-game-reward-overlay.is-fallback .companion-game-reward-frame::before,
.companion-game-reward-overlay.is-fallback .companion-game-reward-frame::after {
  content: "";
  position: absolute;
  inset: 18% 25%;
  border: 2px solid rgba(255, 224, 135, 0.62);
  border-radius: 50%;
  animation: companionRewardPulse 1.6s ease-in-out infinite alternate;
}

.companion-game-reward-overlay.is-fallback .companion-game-reward-frame::after {
  inset: 30%;
  animation-delay: 300ms;
}

@keyframes companionRewardIn {
  from { opacity: 0; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes companionRewardPulse {
  from { transform: scale(0.86); opacity: 0.35; }
  to { transform: scale(1.08); opacity: 0.9; }
}

@media (max-width: 700px) {
  .sol-play-shelf .companion-game-btn {
    min-height: 66px;
  }

  .companion-game-reward-overlay {
    padding-top: max(74px, calc(env(safe-area-inset-top) + 62px));
    padding-bottom: max(92px, calc(env(safe-area-inset-bottom) + 78px));
  }

  .companion-game-reward-frame {
    width: min(94vw, 520px);
    max-height: calc(100dvh - 176px);
  }

  .companion-game-reward-copy {
    inset: auto 14px 14px;
  }
}

@media (orientation: landscape) and (max-height: 560px) {
  .companion-game-reward-overlay {
    padding: 58px 102px 68px;
  }

  .companion-game-reward-frame {
    width: auto;
    height: min(68vh, 360px);
    max-height: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .companion-game-reward-overlay,
  .companion-game-reward-overlay.is-fallback .companion-game-reward-frame::before,
  .companion-game-reward-overlay.is-fallback .companion-game-reward-frame::after {
    animation: none !important;
  }
}
