/* Bubble Pop — self-hosted mini-game styles
   All selectors scoped under .cc-bubble-pop to avoid clashing with host theme. */

.cc-bubble-pop,
.cc-bubble-pop *,
.cc-bubble-pop *::before,
.cc-bubble-pop *::after {
  box-sizing: border-box;
}

.cc-bubble-pop {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 320px;
  overflow: hidden;
  border-radius: 22px;
  background: radial-gradient(120% 90% at 50% 0%, #fff8f3 0%, #fff0f4 45%, #fbf4ee 100%);
  box-shadow: 0 8px 30px rgba(36, 59, 69, 0.12);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  overscroll-behavior: contain;
  touch-action: none;
  isolation: isolate;
}

.cc-bubble-pop::before,
.cc-bubble-pop::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(2px);
  opacity: 0.35;
  pointer-events: none;
  z-index: 0;
}

.cc-bubble-pop::before {
  width: 38%;
  aspect-ratio: 1 / 1;
  top: -10%;
  left: -8%;
  background: radial-gradient(circle, #ffd8e2 0%, transparent 70%);
}

.cc-bubble-pop::after {
  width: 46%;
  aspect-ratio: 1 / 1;
  bottom: -14%;
  right: -10%;
  background: radial-gradient(circle, #dcebe3 0%, transparent 70%);
}

.cc-bubble-pop__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  z-index: 1;
}

/* ---------- HUD ---------- */

.cc-bubble-pop__hud {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  pointer-events: none;
}

.cc-bubble-pop__score {
  display: flex;
  align-items: baseline;
  gap: 6px;
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 16px;
  padding: 6px 14px;
  box-shadow: 0 3px 10px rgba(36, 59, 69, 0.08);
  flex-shrink: 0;
}

.cc-bubble-pop__score-label {
  font-size: clamp(10px, 2.6vw, 12px);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #7a9b8a;
}

.cc-bubble-pop__score-value {
  font-size: clamp(18px, 5vw, 24px);
  font-weight: 800;
  color: #243b45;
  min-width: 1.4em;
  text-align: right;
}

.cc-bubble-pop__timer {
  flex: 1 1 auto;
  height: 10px;
  border-radius: 999px;
  background: rgba(36, 59, 69, 0.1);
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.08);
}

.cc-bubble-pop__timer-fill {
  height: 100%;
  width: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #7a9b8a, #e8b450);
  transition: background 0.3s linear;
}

.cc-bubble-pop__timer-fill.cc-bubble-pop__timer-fill--danger {
  background: linear-gradient(90deg, #ff6b8a, #d4715a);
}

.cc-bubble-pop__combo {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translate(-50%, -6px) scale(0.8);
  margin-top: 4px;
  padding: 4px 14px;
  border-radius: 999px;
  background: linear-gradient(90deg, #ffb800, #ff6b8a);
  color: #fff;
  font-weight: 800;
  font-size: clamp(12px, 3vw, 15px);
  letter-spacing: 0.02em;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(212, 113, 90, 0.35);
}

.cc-bubble-pop__combo.cc-bubble-pop__combo--show {
  animation: cc-bp-combo-pop 0.6s ease-out;
}

@keyframes cc-bp-combo-pop {
  0% { opacity: 0; transform: translate(-50%, -6px) scale(0.6); }
  25% { opacity: 1; transform: translate(-50%, 0) scale(1.08); }
  70% { opacity: 1; transform: translate(-50%, 0) scale(1); }
  100% { opacity: 0; transform: translate(-50%, 4px) scale(0.95); }
}

/* ---------- Overlays ---------- */

.cc-bubble-pop__overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(36, 59, 69, 0.28);
  backdrop-filter: blur(3px);
  transition: opacity 0.2s ease;
}

.cc-bubble-pop__overlay--hidden {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

.cc-bubble-pop__panel {
  width: 100%;
  max-width: 320px;
  background: #fffaf6;
  border-radius: 24px;
  padding: clamp(20px, 6vw, 32px) clamp(18px, 5vw, 26px);
  text-align: center;
  box-shadow: 0 16px 40px rgba(36, 59, 69, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.6);
}

.cc-bubble-pop__badge {
  font-size: clamp(20px, 6vw, 26px);
  color: #ffb800;
  margin-bottom: 6px;
  letter-spacing: 0.15em;
}

.cc-bubble-pop__title {
  margin: 0 0 8px;
  font-size: clamp(22px, 6.5vw, 28px);
  font-weight: 800;
  color: #243b45;
}

.cc-bubble-pop__subtitle {
  margin: 0 0 18px;
  font-size: clamp(13px, 3.6vw, 15px);
  line-height: 1.45;
  color: #5b6f76;
}

.cc-bubble-pop__final-score {
  font-size: clamp(36px, 11vw, 48px);
  font-weight: 800;
  color: #d4715a;
  margin-bottom: 4px;
  line-height: 1;
}

.cc-bubble-pop__best-combo {
  font-size: clamp(12px, 3.4vw, 14px);
  font-weight: 700;
  color: #7a9b8a;
  margin-bottom: 18px;
  min-height: 1.2em;
}

.cc-bubble-pop__btn {
  appearance: none;
  border: none;
  cursor: pointer;
  display: inline-block;
  width: 100%;
  padding: 14px 20px;
  border-radius: 16px;
  background: linear-gradient(135deg, #ff6b8a, #d4715a);
  color: #fff;
  font-size: clamp(15px, 4vw, 17px);
  font-weight: 800;
  letter-spacing: 0.02em;
  box-shadow: 0 8px 20px rgba(212, 113, 90, 0.4);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  touch-action: manipulation;
}

.cc-bubble-pop__btn:active {
  transform: scale(0.96);
  box-shadow: 0 4px 12px rgba(212, 113, 90, 0.35);
}

/* Small phones: tighten HUD padding a touch */
@media (max-width: 360px) {
  .cc-bubble-pop__hud {
    padding: 9px 10px;
    gap: 7px;
  }
  .cc-bubble-pop__score {
    padding: 5px 10px;
  }
}
