/* =========================================================
   BOMBO KAMPANJATEEMA — LAHJAJAHTI (sivukohtaiset CSS-paikat,
   ilmestymisanimaatio ja löytömodaali)
   ========================================================= */

.bombo-gift-hunt-host {
  position: relative;
}

.bombo-gift-hunt-stage {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.55rem;
  margin: 1.15rem 0 0;
  padding: 0.25rem 0.5rem;
  pointer-events: none;
  z-index: 6;
  --bombo-gift-rest-angle: -5deg;
}

/* --- Sivukohtaiset sijoittelut (CSS) --- */

/* Joulukalenteri (/joulukalenteri-2026/) — kalenterin yläkulmassa iloisesti hyppivänä */
.bombo-gift-hunt-stage--joulukalenteri {
  justify-content: flex-end;
  margin: -0.25rem 0 0.85rem;
  padding-right: 0.35rem;
  --bombo-gift-rest-angle: -4deg;
}

/* Videot (/videot/) — videoruudukon oikeassa alakulmassa */
.bombo-gift-hunt-stage--videot {
  justify-content: flex-end;
  margin: 1.2rem 0 0.35rem;
  padding-right: 0.65rem;
  --bombo-gift-rest-angle: -6deg;
}

/* Pelit (/pelit/) — Saavutukset-kuvituksen kulmassa */
.feature-achievements .feature-left.bombo-gift-hunt-host .bombo-gift-hunt-stage--pelit {
  position: absolute;
  right: 0.35rem;
  bottom: -0.75rem;
  margin: 0;
  padding: 0;
  --bombo-gift-rest-angle: 6deg;
}

/* Hahmot (/hahmot/) — sivuhenkilöiden / Joulun väen osion alareunassa */
.bombo-gift-hunt-stage--hahmot {
  justify-content: flex-end;
  margin: 1.35rem 0 0.25rem;
  padding-right: 0.75rem;
  --bombo-gift-rest-angle: -4deg;
}

/* Värityskuvat (/varityskuvat/) — värityskuvaosion alakulmassa */
.bombo-gift-hunt-stage--varityskuvat {
  justify-content: flex-end;
  margin: 1.6rem 0 0;
  padding-right: 0.6rem;
  --bombo-gift-rest-angle: 5deg;
}

/* Tietoa Bombosta (/tietoa-bombosta/) — Bombon maailma -korttien alla reunassa */
.bombo-gift-hunt-stage--tietoa-bombosta {
  justify-content: flex-end;
  margin: 1.25rem 0 0;
  padding-right: 0.5rem;
  --bombo-gift-rest-angle: -5deg;
}

/* Bombon Kerho (/bombon-kerho/) — metsäkuvituksen alakulmassa */
.kerho-story-media.bombo-gift-hunt-host .bombo-gift-hunt-stage--bombon-kerho {
  position: absolute;
  right: 0.65rem;
  bottom: -0.85rem;
  margin: 0;
  padding: 0;
  --bombo-gift-rest-angle: 6deg;
}

/* Etusivu (/) — Kerho-osion tai sisällön kulmassa (valinnainen) */
.bombo-gift-hunt-stage--etusivu {
  justify-content: flex-end;
  margin: 1rem 0 0;
  padding-right: 0.5rem;
  --bombo-gift-rest-angle: -5deg;
}

/* Bombon Mökki (/bombon-mokki/) — esittelykuvan kulmassa (valinnainen) */
.app-showcase.bombo-gift-hunt-host .bombo-gift-hunt-stage--bombon-mokki {
  position: absolute;
  right: 0.5rem;
  bottom: -0.65rem;
  margin: 0;
  padding: 0;
  --bombo-gift-rest-angle: 5deg;
}

/* RadioMustikka (/radio/) — Mustikka Mikko -osion alakulmassa (valinnainen) */
.bombo-gift-hunt-stage--radio {
  justify-content: flex-end;
  margin: 1.15rem 0 0;
  padding-right: 0.5rem;
  --bombo-gift-rest-angle: -5deg;
}

@media (max-width: 720px) {
  .feature-achievements .feature-left.bombo-gift-hunt-host .bombo-gift-hunt-stage--pelit,
  .kerho-story-media.bombo-gift-hunt-host .bombo-gift-hunt-stage--bombon-kerho,
  .app-showcase.bombo-gift-hunt-host .bombo-gift-hunt-stage--bombon-mokki {
    right: 0.25rem;
    bottom: -0.55rem;
  }
}

/* --- Lahjapainike & animaatiot --- */

.bombo-gift-hunt-btn {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: clamp(68px, 8.5vw, 86px);
  height: clamp(68px, 8.5vw, 86px);
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  pointer-events: auto;
  opacity: 0;
  transform: translateY(24px) scale(0.35) rotate(-16deg);
  -webkit-tap-highlight-color: transparent;
  isolation: isolate;
}

/* Lämmin kultainen hehku paketin takana */
.bombo-gift-hunt-btn::before {
  content: "";
  position: absolute;
  inset: -10px;
  z-index: -1;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(255, 226, 132, 0.58) 0%,
    rgba(255, 198, 92, 0.24) 44%,
    rgba(255, 198, 92, 0) 72%
  );
  opacity: 0.85;
  animation: bomboGiftGlow 2.8s ease-in-out infinite;
  pointer-events: none;
}

/* Pienet tuikkivat tähdet paketin ympärillä */
.bombo-gift-hunt-btn::after {
  content: "";
  position: absolute;
  inset: -8px;
  z-index: 2;
  background-image:
    radial-gradient(circle at 16% 20%, #fff7cf 0 2.2px, transparent 3px),
    radial-gradient(circle at 86% 18%, #ffe28a 0 2.6px, transparent 3.5px),
    radial-gradient(circle at 84% 78%, #fff7cf 0 2px, transparent 3px);
  opacity: 0;
  animation: bomboGiftSparkles 3.2s ease-in-out infinite;
  pointer-events: none;
}

.bombo-gift-hunt-btn__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 10px 16px rgba(7, 18, 32, 0.42));
  transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.22s ease;
  pointer-events: none;
  user-select: none;
}

.bombo-gift-hunt-btn.is-revealed {
  animation:
    bomboGiftPopIn 0.72s cubic-bezier(0.34, 1.56, 0.64, 1) forwards,
    bomboGiftJump 2.9s ease-in-out 0.85s infinite;
}

.bombo-gift-hunt-btn:hover .bombo-gift-hunt-btn__img,
.bombo-gift-hunt-btn:focus-visible .bombo-gift-hunt-btn__img {
  transform: scale(1.11) translateY(-3px);
  filter: drop-shadow(0 14px 20px rgba(7, 18, 32, 0.5)) brightness(1.05);
}

.bombo-gift-hunt-btn:focus-visible {
  outline: 3px solid #ffe48f;
  outline-offset: 4px;
}

.bombo-gift-hunt-btn.is-opening .bombo-gift-hunt-btn__img {
  transform: scale(1.22) rotate(0deg);
}

.bombo-gift-hunt-badge {
  position: absolute;
  bottom: -4px;
  right: -4px;
  z-index: 3;
  padding: 2px 7px;
  border-radius: 999px;
  background: #0d2b3e;
  border: 1px solid rgba(124, 232, 213, 0.65);
  color: #dffcf5;
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: 0.02em;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.32);
  pointer-events: none;
}

.bombo-gift-hunt-preview-pill {
  pointer-events: auto;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(12, 35, 54, 0.92);
  border: 1px solid rgba(255, 220, 125, 0.65);
  color: #ffe8a3;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}

@keyframes bomboGiftPopIn {
  0% {
    opacity: 0;
    transform: translateY(24px) scale(0.35) rotate(-16deg);
  }
  65% {
    opacity: 1;
    transform: translateY(-5px) scale(1.08) rotate(calc(var(--bombo-gift-rest-angle, -5deg) * -0.6));
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1) rotate(var(--bombo-gift-rest-angle, -5deg));
  }
}

@keyframes bomboGiftJump {
  0%, 58%, 100% {
    transform: translateY(0) scale(1, 1) rotate(var(--bombo-gift-rest-angle, -5deg));
  }
  63% {
    transform: translateY(2px) scale(1.07, 0.93) rotate(var(--bombo-gift-rest-angle, -5deg));
  }
  71% {
    transform: translateY(-11px) scale(0.96, 1.05) rotate(calc(var(--bombo-gift-rest-angle, -5deg) - 7deg));
  }
  78% {
    transform: translateY(0) scale(1.05, 0.95) rotate(calc(var(--bombo-gift-rest-angle, -5deg) + 3deg));
  }
  85% {
    transform: translateY(-6px) scale(0.98, 1.03) rotate(calc(var(--bombo-gift-rest-angle, -5deg) + 7deg));
  }
  92% {
    transform: translateY(0) scale(1.02, 0.98) rotate(var(--bombo-gift-rest-angle, -5deg));
  }
}

@keyframes bomboGiftGlow {
  0%, 100% {
    transform: scale(0.95);
    opacity: 0.72;
  }
  50% {
    transform: scale(1.1);
    opacity: 1;
  }
}

@keyframes bomboGiftSparkles {
  0%, 100% {
    opacity: 0.18;
    transform: scale(0.94);
  }
  50% {
    opacity: 0.92;
    transform: scale(1.05);
  }
}

@media (prefers-reduced-motion: reduce) {
  .bombo-gift-hunt-btn.is-revealed {
    animation: none;
    opacity: 1;
    transform: rotate(var(--bombo-gift-rest-angle, -4deg));
  }
  .bombo-gift-hunt-btn::before,
  .bombo-gift-hunt-btn::after {
    animation: none;
  }
}

/* =========================================================
   LÖYTÖMODAALI
   ========================================================= */

.bombo-gift-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: grid;
  place-items: center;
  padding: clamp(0.85rem, 3vw, 1.5rem);
  background: rgba(4, 14, 24, 0.76);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  overflow-y: auto;
  animation: bomboModalFadeIn 0.2s ease-out;
}

.bombo-gift-modal-backdrop[hidden] {
  display: none !important;
}

.bombo-gift-modal {
  position: relative;
  width: min(520px, 100%);
  margin: auto;
  padding: clamp(1.35rem, 4vw, 2.1rem);
  border: 1px solid rgba(110, 228, 206, 0.42);
  border-radius: 24px;
  background:
    radial-gradient(circle at 88% 10%, rgba(74, 218, 185, 0.2), transparent 38%),
    radial-gradient(circle at 12% 8%, rgba(255, 214, 118, 0.14), transparent 34%),
    linear-gradient(150deg, #0c213a 0%, #0b2f3f 100%);
  color: #f3fbf9;
  box-shadow: 0 28px 72px rgba(2, 10, 20, 0.58);
  text-align: center;
  animation: bomboModalCardPop 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

.bombo-gift-modal__close {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(182, 232, 224, 0.26);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  color: #e4f7f3;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

.bombo-gift-modal__close:hover,
.bombo-gift-modal__close:focus-visible {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  outline: 2px solid #7ce8d5;
  outline-offset: 2px;
}

.bombo-gift-modal__icon {
  display: block;
  width: 78px;
  height: 78px;
  margin: 0 auto 0.65rem;
  object-fit: contain;
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.36));
}

.bombo-gift-modal__title {
  margin: 0 0 0.55rem;
  color: #ffffff;
  font-size: clamp(1.4rem, 4vw, 1.85rem);
  line-height: 1.18;
}

.bombo-gift-modal__body {
  margin: 0 auto 1rem;
  max-width: 44ch;
  color: rgba(233, 250, 247, 0.92);
  font-size: 0.99rem;
  line-height: 1.56;
}

.bombo-gift-modal__pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.45rem;
  margin: 0 auto 1.25rem;
  padding: 0;
  list-style: none;
}

.bombo-gift-modal__pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.34rem 0.72rem;
  border-radius: 999px;
  border: 1px solid rgba(124, 232, 213, 0.36);
  background: rgba(43, 179, 164, 0.13);
  color: #e4fcf7;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.3;
}

.bombo-gift-modal__pill::before {
  content: "✓";
  color: #6ee7b7;
  font-weight: 900;
}

.bombo-gift-modal__redeem-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  width: 100%;
  min-height: 54px;
  padding: 0.85rem 1.35rem;
  border: 1px solid rgba(178, 252, 234, 0.62);
  border-radius: 14px;
  background: linear-gradient(135deg, #2ec2b1 0%, #1b8c9e 100%);
  color: #ffffff !important;
  font: inherit;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  text-decoration: none !important;
  box-shadow: 0 12px 28px rgba(0, 22, 34, 0.38);
  transition: filter 0.16s ease, transform 0.16s ease;
}

.bombo-gift-modal__redeem-btn:hover,
.bombo-gift-modal__redeem-btn:focus-visible {
  filter: brightness(1.08);
  transform: translateY(-1px);
  color: #ffffff !important;
}

.bombo-gift-modal__note {
  margin: 0.75rem auto 0;
  max-width: 44ch;
  color: rgba(190, 228, 222, 0.86);
  font-size: 0.83rem;
  line-height: 1.48;
}

.bombo-gift-modal__code-row {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1.05rem;
  padding: 0.45rem 0.55rem 0.45rem 0.85rem;
  border: 1px dashed rgba(132, 238, 216, 0.32);
  border-radius: 11px;
  background: rgba(6, 20, 32, 0.58);
}

.bombo-gift-modal__code-label {
  color: rgba(186, 225, 219, 0.78);
  font-size: 0.79rem;
}

.bombo-gift-modal__code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #ffffff;
  user-select: all;
}

.bombo-gift-modal__copy-btn {
  flex: none;
  min-height: 30px;
  padding: 0.25rem 0.65rem;
  border: 1px solid rgba(145, 238, 218, 0.38);
  border-radius: 8px;
  background: rgba(43, 179, 164, 0.16);
  color: #dffcf5;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease;
}

.bombo-gift-modal__copy-btn:hover,
.bombo-gift-modal__copy-btn:focus-visible {
  background: rgba(43, 179, 164, 0.3);
  border-color: #8bf0db;
}

.bombo-gift-modal__loading {
  padding: 1.5rem 0;
  color: #cdeee7;
  font-size: 0.96rem;
}

@media (max-width: 500px) {
  .bombo-gift-modal__pills {
    gap: 0.38rem;
  }
  .bombo-gift-modal__pill {
    font-size: 0.78rem;
    padding: 0.3rem 0.62rem;
  }
}

@keyframes bomboModalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes bomboModalCardPop {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
