/* ============================================================================
   SUPERPOPS COMBINED STYLES - Optimized for Performance
   This is the SINGLE source of truth for storefront + /play styles — it is the
   only stylesheet loaded (superpops-game.liquid + play.tsx). Per-game styles
   are inlined below under their own section headers ("inlined from <game>.css");
   the standalone per-game .css files were removed (they were never loaded and
   editing them did nothing). Add new game styles HERE.
   ============================================================================ */

/* ============================================================================
   Z-INDEX SCALE
   999999 — overlay (above everything on the merchant storefront)
       10 — close button / floating UI within popup
        5 — raised game elements (revealed content, scratch layer)
        3 — stacked game layers (top)
        2 — stacked game layers (middle)
        1 — stacked game layers (base)
   ============================================================================ */

/* ============================================================================
   COMMON GAME STYLES
   ============================================================================ */

/* ============================================================================
   OVERLAY & POPUP BASE
   ============================================================================ */

.superpops-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999999;
  opacity: 0;
  transition: opacity 0.3s ease;
  padding: 20px;
  box-sizing: border-box;
}

.superpops-overlay.active {
  opacity: 1;
}

.superpops-popup {
  background: white;
  border-radius: 20px;
  max-width: 420px;
  width: 100%;
  max-height: 90vh;
  overflow: hidden;
  position: relative;
  font-family: var(
    --font-family,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    "Helvetica Neue",
    Arial,
    sans-serif
  );
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  /* Spring-physics entrance (WEB-2013): cubic-bezier easeOutBack gives
     a tight overshoot-and-settle without a JS library. translateY + scale
     combine for a "popping forward" feel — premium, not draggy.
     prefers-reduced-motion override below uses a simple fade. */
  animation: popupSpringIn 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex;
  flex-direction: column;
}

@keyframes popupSpringIn {
  from {
    transform: translateY(-12px) scale(0.96);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

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

@media (prefers-reduced-motion: reduce) {
  .superpops-popup {
    animation: popupFadeIn 0.2s ease-out;
  }
}

/* ============================================================================
   POPUP HEADER
   ============================================================================ */

.superpops-close {
  position: absolute;
  top: 8px;
  right: 8px;
  background: transparent;
  border: none;
  /* 44×44px touch target; SVG icon sized inside */
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  max-width: 44px;
  max-height: 44px;
  padding: 0;
  margin: 0;
  border-radius: 50%;
  font-size: 16px;
  line-height: 1;
  font-weight: 400;
  letter-spacing: normal;
  text-transform: none;
  cursor: pointer;
  color: #333;
  transition: background 0.2s ease;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
+  flex-shrink: 0;
  -webkit-appearance: none;
  appearance: none;
  box-shadow: none;
  /* Defend against host theme CSS bleeding into embedded popup */
  width: 44px !important;
  height: 44px !important;
  min-width: 44px !important;
  min-height: 44px !important;
  max-width: 44px !important;
  max-height: 44px !important;
  padding: 0 !important;
  margin: 0 !important;
}

.superpops-close-icon {
  display: block;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  pointer-events: none;
}

.superpops-close:hover {
  background: rgba(0, 0, 0, 0.2);
}

.superpops-content {
  padding: 24px 24px 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.superpops-branding {
  text-align: center;
  padding: 8px 0 12px;
  font-size: 11px;
}

.superpops-branding a {
  color: #aaa;
  text-decoration: none;
}

.superpops-branding a:hover {
  color: #888;
}

/* ============================================================================
   POPUP LAYOUT VARIANTS
   ============================================================================ */

/* Layout Image Container */
.superpops-layout-image {
  flex-shrink: 0;
  overflow: hidden;
  background: #f0f0f0;
}

.superpops-layout-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  min-height: 100%;
}

/* Main Content Container */
.superpops-main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* NO_IMAGE Layout (default) */
.superpops-popup--no_image {
  max-width: 420px;
}

.superpops-popup--no_image .superpops-content {
  flex-direction: column;
}

/* TOP_IMAGE Layout */
.superpops-popup--top_image {
  max-width: 480px;
}

.superpops-popup--top_image .superpops-content {
  padding: 0;
  flex-direction: column;
}

.superpops-popup--top_image .superpops-layout-image {
  width: 100%;
  height: 180px;
  border-radius: var(--popup-border-radius, 20px) var(--popup-border-radius, 20px) 0 0;
}

.superpops-popup--top_image .superpops-main-content {
  padding: 24px 24px 20px;
}

/* LEFT_IMAGE Layout */
.superpops-popup--left_image {
  max-width: 700px;
}

.superpops-popup--left_image .superpops-content {
  padding: 0;
  flex-direction: row;
}

.superpops-popup--left_image .superpops-layout-image {
  width: 45%;
  min-height: 400px;
  height: auto;
  align-self: stretch;
  border-radius: var(--popup-border-radius, 20px) 0 0 var(--popup-border-radius, 20px);
}

.superpops-popup--left_image .superpops-main-content {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
}

/* RIGHT_IMAGE Layout */
.superpops-popup--right_image {
  max-width: 700px;
}

.superpops-popup--right_image .superpops-content {
  padding: 0;
  flex-direction: row;
}

.superpops-popup--right_image .superpops-layout-image {
  width: 45%;
  min-height: 400px;
  height: auto;
  align-self: stretch;
  order: 2;
  border-radius: 0 var(--popup-border-radius, 20px) var(--popup-border-radius, 20px) 0;
}

.superpops-popup--right_image .superpops-main-content {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
  order: 1;
}

.superpops-title {
  font-size: 22px;
  font-weight: 700;
  color: #1a1a1a;
  margin: 0 0 8px;
  text-align: center;
  line-height: 1.3;
}

.superpops-description {
  font-size: 14px;
  color: #666;
  margin: 0 0 16px;
  text-align: center;
  line-height: 1.5;
}

/* ============================================================================
   GAME CONTAINER
   ============================================================================ */

.superpops-game-container {
  margin: 0 0 12px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.superpops-game-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
  color: #888;
  margin: 10px 0 0;
  font-size: 13px;
}

.superpops-game-hint svg {
  flex-shrink: 0;
}

/* ============================================================================
   FORM CONTAINER & INPUTS
   ============================================================================ */

.superpops-form-container {
  animation: fadeIn 0.4s ease;
  flex: 1;
  display: flex;
  flex-direction: column;
}

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

.superpops-instructions {
  text-align: center;
  color: #666;
  margin-bottom: 16px;
  font-size: 14px;
  line-height: 1.5;
}

.superpops-form {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.superpops-form .superpops-form-field,
.superpops-form .superpops-button,
.superpops-form .superpops-error {
  width: 100%;
  align-self: stretch;
}

.superpops-input {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid #e0e0e0;
  border-radius: 8px;
  font-size: 15px;
  transition: all 0.2s ease;
  box-sizing: border-box;
  background: #fafafa;
  /* Defend against host theme CSS bleeding into embedded popup */
  color: #1a1a1a !important;
  text-align: left !important;
  font-family: inherit;
}

.superpops-input:focus {
  outline: none;
  border-color: var(--brand-color, #7B61FF);
  box-shadow: 0 0 0 3px rgba(123, 97, 255, 0.08);
  background: #fff;
}

.superpops-input::placeholder {
  color: #999;
}

.superpops-checkbox-wrapper {
  display: flex;
  align-items: center;
  padding: 10px 0;
}

.superpops-checkbox-label {
  display: flex;
  align-items: center;
  cursor: pointer;
  font-size: 16px;
  color: #333;
}

.superpops-checkbox {
  margin-right: 10px;
  width: 20px;
  height: 20px;
  cursor: pointer;
}

.superpops-privacy-note {
  text-align: center;
  color: #999;
  font-size: 12px;
  margin: 5px 0 0;
}

.superpops-error {
  background: #fee;
  color: #c33;
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 15px;
  font-size: 14px;
  text-align: center;
  animation: shake 0.3s ease;
}

@keyframes shake {
  0%, 100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-5px);
  }
  75% {
    transform: translateX(5px);
  }
}

/* ============================================================================
   BUTTONS
   ============================================================================ */

.superpops-button {
  --superpops-button-face: var(--brand-color, #7B61FF);
  --superpops-button-depth: color-mix(in srgb, var(--brand-color, #7B61FF) 64%, #111827);
  --superpops-button-border: color-mix(in srgb, var(--brand-color, #7B61FF) 72%, #111827);
  --superpops-button-glow: color-mix(in srgb, var(--brand-color, #7B61FF) 22%, transparent);
  width: 100%;
  min-height: 48px;
  padding: 12px 20px;
  border: 1px solid var(--superpops-button-border);
  border-radius: 10px;
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--superpops-button-face) 90%, white),
    color-mix(in srgb, var(--superpops-button-face) 92%, #111827)
  );
  color: white;
  font-size: 15px;
  font-weight: 750;
  cursor: pointer;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    0 5px 0 var(--superpops-button-depth),
    0 11px 20px var(--superpops-button-glow);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-sizing: border-box;
  -webkit-appearance: none;
  appearance: none;
  transition: transform 130ms ease, opacity 180ms ease, box-shadow 130ms ease;
  letter-spacing: 0.3px;
}

.superpops-button:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    0 7px 0 var(--superpops-button-depth),
    0 14px 24px var(--superpops-button-glow);
}

.superpops-button:active:not(:disabled) {
  transform: translateY(3px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.24),
    0 2px 0 var(--superpops-button-depth);
}

.superpops-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ============================================================================
   SUCCESS & LOSE CONTAINERS - MINIMALIST DESIGN
   ============================================================================ */

.superpops-success-container,
.superpops-lose-container {
  position: relative;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 24px;
  width: 100%;
  min-height: 280px;
  box-sizing: border-box;
}

.superpops-success-container:focus {
  outline: none;
}

/* Confetti Canvas */
.superpops-confetti-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

/* Success Content */
.superpops-success-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  animation: successFadeIn 0.5s ease;
}

@keyframes successFadeIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.superpops-success-emoji {
  font-size: 56px;
  animation: celebrateBounce 0.6s ease;
}

@keyframes celebrateBounce {
  0% { transform: scale(0); }
  50% { transform: scale(1.3); }
  70% { transform: scale(0.9); }
  100% { transform: scale(1); }
}

.superpops-success-title {
  font-size: 28px;
  font-weight: 800;
  color: #1a1a1a;
  margin: 0;
  letter-spacing: -0.5px;
}

.superpops-success-prize {
  font-size: 20px;
  font-weight: 700;
  color: var(--brand-color, #7B61FF);
  margin: 0 0 12px;
  letter-spacing: 1px;
}

/* Reward code is one large copy target, not a small icon-only control. */
.superpops-code-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: #f8f9fa;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 12px 16px;
  margin: 4px 0;
  width: 100%;
  min-height: 52px;
  box-sizing: border-box;
  color: #1a1a1a;
  cursor: pointer;
  font: inherit;
  text-align: left;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.superpops-code-box .superpops-code-display {
  background: transparent;
  border: none;
  padding: 0;
  font-size: 18px;
  font-weight: 700;
  font-family: "SF Mono", "Fira Code", "Courier New", monospace;
  color: #1a1a1a;
  letter-spacing: 2px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.superpops-copy-action {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--brand-color, #7B61FF);
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}

.superpops-code-box:hover:not(:disabled) {
  border-color: color-mix(in srgb, var(--brand-color, #7B61FF) 48%, #e5e7eb);
  background: color-mix(in srgb, var(--brand-color, #7B61FF) 5%, white);
}

.superpops-code-box:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--brand-color, #7B61FF) 28%, transparent);
  outline-offset: 2px;
  border-color: var(--brand-color, #7B61FF);
}

.superpops-code-box.copied {
  border-color: #10B981;
  background: #ecfdf5;
}
.superpops-code-box.copied .superpops-copy-action {
  color: #047857;
}

.superpops-copy-action svg {
  width: 18px;
  height: 18px;
}

.superpops-visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Lose Content */
.superpops-lose-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  animation: loseFadeIn 0.5s ease;
}

@keyframes loseFadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.superpops-lose-emoji {
  font-size: 48px;
  animation: gentleShake 0.5s ease;
}

@keyframes gentleShake {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-5deg); }
  75% { transform: rotate(5deg); }
}

.superpops-lose-title {
  font-size: 24px;
  font-weight: 700;
  color: #4B5563;
  margin: 0;
}

.superpops-lose-message {
  font-size: 15px;
  color: #9CA3AF;
  margin: 0 0 16px;
}

/* ============================================================================
   MINIMALIST SUCCESS/LOSE BUTTON STYLES
   ============================================================================ */

.superpops-button--success {
  padding: 14px 32px;
  font-size: 15px;
  font-weight: 750;
  border-radius: 12px;
}

.superpops-button.superpops-button--lose {
  --superpops-button-face: #e5e7eb;
  --superpops-button-depth: #c4c9d1;
  --superpops-button-border: #cbd0d8;
  --superpops-button-glow: rgba(75, 85, 99, 0.14);
  color: #4B5563;
  padding: 14px 32px;
  font-size: 15px;
  font-weight: 750;
  border-radius: 12px;
}

.superpops-button.superpops-button--lose:hover:not(:disabled) {
  color: #374151;
}

/* ============================================================================
   ENHANCED FORM STYLES
   ============================================================================ */

.superpops-form-header {
  text-align: center;
  margin-bottom: 16px;
  padding-top: 20px; /* Prevent collision with close button */
  animation: slideUp 0.5s ease;
}

.superpops-form-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: linear-gradient(135deg, #10B981 0%, #059669 100%);
  color: white;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
  animation: badgePop 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

.superpops-form-badge svg {
  width: 14px;
  height: 14px;
}

@keyframes badgePop {
  0% { transform: scale(0.7); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.superpops-form-icon {
  font-size: 48px;
  margin-bottom: 4px;
  animation: scaleIn 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

.superpops-form-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--brand-color, #7B61FF);
  margin: 0 0 4px;
}

.superpops-input-group {
  margin-bottom: 4px;
}

.superpops-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #4B5563;
  margin-bottom: 6px;
}

.superpops-label svg {
  color: var(--brand-color, #7B61FF);
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.superpops-submit-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 8px;
}

.superpops-button-text {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.superpops-button-text svg {
  flex-shrink: 0;
}

.superpops-button-loading {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.superpops-spinner {
  animation: spin 1s linear infinite;
}

.superpops-privacy {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 11px;
  color: #9CA3AF;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #f0f0f0;
}

.superpops-privacy svg {
  color: #10B981;
  flex-shrink: 0;
  width: 12px;
  height: 12px;
}

/* ============================================================================
   MINIMAL FORM STYLES - Matches Win/Lose Screen Design
   ============================================================================ */

.superpops-form-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 16px 0;
  animation: successFadeIn 0.5s ease;
}

.superpops-form-emoji {
  font-size: 48px;
  margin-bottom: 8px;
  animation: celebrateBounce 0.6s ease;
}

.superpops-form-heading {
  font-size: 24px;
  font-weight: 800;
  color: #1a1a1a;
  margin: 0 0 4px;
  letter-spacing: -0.3px;
}

.superpops-form-subtext {
  font-size: 15px;
  color: #4B5563;
  margin: 0 0 20px;
}

.superpops-form--minimal {
  width: 100%;
  gap: 10px;
}

.superpops-input--minimal {
  background: #f8f9fa;
  border: 1.5px solid transparent;
  border-radius: 10px;
  padding: 14px 16px;
  font-size: 15px;
  text-align: center;
  transition: all 0.2s ease;
}

.superpops-input--minimal:focus {
  background: #fff;
  border-color: var(--brand-color, #7B61FF);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-color, #7B61FF) 10%, transparent);
}

.superpops-input--minimal::placeholder {
  color: #9CA3AF;
}

.superpops-button--claim {
  padding: 14px 32px;
  font-size: 15px;
  font-weight: 750;
  border-radius: 12px;
  margin-top: 6px;
}

.superpops-button--claim:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.superpops-button--claim .superpops-button-loading {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.superpops-form-privacy {
  font-size: 12px;
  color: #9CA3AF;
  margin: 12px 0 0;
}

/* ============================================================================
   ANIMATIONS
   ============================================================================ */

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

/* Enhanced scratch card styles are now in the main scratch card section */

/* ============================================================================
   UTILITY CLASSES
   ============================================================================ */

.superpops-loader {
  border: 4px solid #f3f3f3;
  border-top: 4px solid var(--brand-color, #7B61FF);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* ============================================================================
   SCRATCH CARD GAME SPECIFIC STYLES
   ============================================================================ */

.superpops-scratch-wrapper {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.superpops-scratch-header {
  text-align: center;
  margin-bottom: 4px;
}

.superpops-scratch-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: var(--brand-color, #7B61FF);
  color: white;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  animation: badgePop 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

.superpops-scratch-badge svg {
  width: 14px;
  height: 14px;
}


.superpops-scratch-area {
  position: relative;
  width: 100%;
  max-width: 300px;
  margin: 0 auto;
  aspect-ratio: 1;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
  border: 2px solid var(--brand-color, #7B61FF);
}

.superpops-result {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--brand-color, #7B61FF) 5%, white) 0%,
    color-mix(in srgb, var(--brand-color, #7B61FF) 10%, white) 100%
  );
  z-index: 1;
}

.superpops-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  cursor: grab;
  z-index: 2;
  touch-action: none;
  animation: sp-scratch-invite 2.4s ease-in-out infinite;
}

.superpops-canvas:active {
  cursor: grabbing;
}

.superpops-canvas.is-started {
  animation: none;
}

.superpops-canvas:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--brand-color, #7B61FF) 32%, transparent);
  outline-offset: -6px;
}

@keyframes sp-scratch-invite {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.08); }
}

.superpops-scratch-progress {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: min(100%, 300px);
  margin: 0 auto;
  color: #6B7280;
  font-size: 12px;
  font-weight: 650;
  text-align: left;
}

.superpops-scratch-progress-track {
  display: block;
  height: 5px;
  overflow: hidden;
  background: color-mix(in srgb, var(--brand-color, #7B61FF) 14%, #e5e7eb);
  border-radius: 999px;
}

.superpops-scratch-progress-fill {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--brand-color, #7B61FF);
  border-radius: inherit;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.18s ease-out;
}

/* Particles container */
.superpops-scratch-particles {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 3;
  overflow: hidden;
}

.superpops-scratch-particle {
  position: absolute;
  font-size: 14px;
  pointer-events: none;
  animation: scratchParticle 0.8s ease-out forwards;
  opacity: 0;
}

@keyframes scratchParticle {
  0% {
    opacity: 1;
    transform: translate(0, 0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(var(--dx, 20px), var(--dy, -30px)) scale(0.5);
  }
}

/* Result content */
.superpops-scratch-result-content {
  text-align: center;
  padding: 16px;
}

.superpops-scratch-result-badge {
  font-size: 48px;
  margin-bottom: 8px;
  animation: resultBounce 0.6s ease;
}

.superpops-scratch-result-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--brand-color, #7B61FF);
  margin-bottom: 4px;
}

.superpops-scratch-win .superpops-scratch-result-title {
  color: var(--brand-color, #7B61FF);
}

.superpops-scratch-lose .superpops-scratch-result-title {
  color: #4B5563;
}

.superpops-scratch-result-prize {
  font-size: 28px;
  font-weight: 800;
  color: var(--brand-color, #7B61FF);
  letter-spacing: -0.5px;
}

.superpops-scratch-result-subtitle {
  font-size: 14px;
  color: #9CA3AF;
  margin-top: 4px;
}

@keyframes resultBounce {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.2); }
}

/* Revealed state */
.superpops-scratch-wrapper.revealed .superpops-scratch-result-content {
  animation: revealPulse 0.5s ease;
}

@keyframes revealPulse {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.02); }
  100% { transform: scale(1); opacity: 1; }
}

/* Loader */
.superpops-scratch-loader {
  display: flex;
  align-items: center;
  justify-content: center;
}

.superpops-scratch-loader-circle {
  width: 32px;
  height: 32px;
  border: 3px solid color-mix(in srgb, var(--brand-color, #7B61FF) 20%, white);
  border-top-color: var(--brand-color, #7B61FF);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* Hint icon */
.superpops-hint-icon {
  margin-right: 4px;
}

/* Legacy support - Win/Lose Messages */
.superpops-win-message,
.superpops-lose-message {
  text-align: center;
  padding: 16px;
}

.superpops-win-icon,
.superpops-lose-icon {
  font-size: 48px;
  animation: scaleIn 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

.superpops-win-message h3,
.superpops-lose-message h3 {
  font-size: 20px;
  margin: 8px 0;
  color: inherit;
}

.superpops-prize-text {
  font-size: 32px;
  font-weight: bold;
  margin: 10px 0 0;
}

/* ============================================================================
   SPIN WHEEL GAME SPECIFIC STYLES
   ============================================================================ */

.superpops-wheel-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  width: 100%;
  margin: 4px 0 8px;
}

.superpops-wheel-header {
  text-align: center;
  margin-bottom: 4px;
}

.superpops-wheel-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: var(--brand-color, #7B61FF);
  color: white;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  animation: badgePop 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

.superpops-wheel-badge svg {
  width: 14px;
  height: 14px;
}

.superpops-wheel-stage {
  position: relative;
  width: min(100%, 300px);
  padding: 8px;
  border-radius: 50%;
  background: transparent;
  box-sizing: border-box;
}

.superpops-wheel-area {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  margin: 0 auto;
}

.superpops-wheel-outer-ring {
  position: absolute;
  inset: -4px;
  /* The ring extends beyond the wheel; theme-wide max-width rules must not clamp it. */
  max-width: none;
  border-radius: 50%;
  background: color-mix(in srgb, var(--brand-color, #7B61FF) 72%, #111827);
  box-shadow:
    0 8px 20px rgba(17, 24, 39, 0.16),
    inset 0 0 0 1px rgba(255, 255, 255, 0.22);
}

.superpops-wheel-pointer {
  position: absolute;
  top: -9px;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 32px;
  color: color-mix(in srgb, var(--brand-color, #7B61FF) 76%, #111827);
  z-index: 10;
  filter: drop-shadow(0 2px 2px rgba(17, 24, 39, 0.24));
  animation: pointerBounce 1.5s ease-in-out infinite;
  transform-origin: 50% 9px;
}

.superpops-wheel-pointer-default,
.superpops-wheel-pointer-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.superpops-wheel-area.spinning .superpops-wheel-pointer {
  animation: sp-wheel-pointer-tick 140ms ease-in-out infinite alternate;
}

@keyframes pointerBounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(2px); }
}

@keyframes sp-wheel-pointer-tick {
  from { transform: translateX(-50%) rotate(-5deg); }
  to { transform: translateX(-50%) rotate(5deg); }
}

.superpops-wheel-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  z-index: 2;
}

.superpops-wheel-center-cap {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 3px solid color-mix(in srgb, var(--brand-color, #7B61FF) 72%, #111827);
  background: #fff;
  color: var(--brand-color, #7B61FF);
  box-shadow: 0 2px 7px rgba(17, 24, 39, 0.18);
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-sizing: border-box;
}

.superpops-wheel-center-mark {
  width: 16px;
  height: 16px;
}

.superpops-wheel-center-img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.superpops-spin-button {
  width: 100%;
  max-width: 286px;
  min-height: 54px;
  padding: 14px 24px;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.5px;
  gap: 8px;
}

.superpops-spin-button svg {
  flex-shrink: 0;
  transition: transform 0.3s ease;
}

.superpops-spin-button .spinning-icon {
  animation: spin 1s linear infinite;
}

.superpops-spin-button.spinning {
  opacity: 0.78;
  cursor: not-allowed;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    0 3px 0 var(--superpops-button-depth);
}

.superpops-wheel-status {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.superpops-wheel-area.is-win .superpops-wheel-outer-ring {
  box-shadow:
    0 0 0 4px color-mix(in srgb, var(--brand-color, #7B61FF) 10%, transparent),
    0 10px 22px color-mix(in srgb, var(--brand-color, #7B61FF) 22%, transparent);
}

.superpops-wheel-area.is-landed .superpops-wheel-pointer {
  animation: sp-wheel-landed 0.42s ease-out both;
}

@keyframes sp-wheel-landed {
  0% { transform: translateX(-50%) translateY(-4px) scale(0.9); }
  100% { transform: translateX(-50%) translateY(0) scale(1); }
}

/* ============================================================================
   MYSTERY BOX GAME SPECIFIC STYLES
   ============================================================================ */

.superpops-mystery-area {
  padding: 10px 0 12px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 100%;
}

/* The storefront theme's button:hover must not paint a tile behind the gift. */
.superpops-mystery-area button.superpops-mystery-box,
.superpops-mystery-area button.superpops-mystery-box:is(:hover, :focus, :active, :disabled) {
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
  margin: 0;
  min-width: 0;
  min-height: 0;
  width: 100%;
  color: inherit;
  font: inherit;
  letter-spacing: normal;
  text-transform: none;
  appearance: none;
}

.superpops-mystery-area button.superpops-mystery-box::before,
.superpops-mystery-area button.superpops-mystery-box::after {
  content: none;
}

.superpops-mystery-area button.superpops-mystery-box:focus-visible {
  outline: 3px solid var(--brand-color, #7B61FF);
  outline-offset: 3px;
  border-radius: 12px;
}

.superpops-mystery-area.is-revealed .superpops-mystery-boxes {
  grid-template-columns: minmax(0, 128px) !important;
  justify-content: center;
  width: 100%;
}

.superpops-mystery-area.is-revealed {
  padding: 22px 0 4px;
  gap: 0;
}

.superpops-popup--mystery-box #superpops-game-footer,
.superpops-popup--mystery-box #superpops-game-header .superpops-block-text {
  transition: opacity 180ms ease-out;
}

.superpops-popup--mystery-box:has(.superpops-mystery-area.is-selecting) #superpops-game-footer,
.superpops-popup--mystery-box:has(.superpops-mystery-area.is-selecting) #superpops-game-header .superpops-block-text {
  opacity: 0;
}

.superpops-popup.superpops-popup--mystery-moving {
  background: transparent !important;
  box-shadow: none;
  overflow: visible;
  isolation: isolate;
}

.superpops-popup--mystery-moving .superpops-content {
  position: relative;
  z-index: 1;
}

.superpops-popup--mystery-moving .superpops-main-content {
  overflow: visible;
}

.superpops-popup--mystery-moving .superpops-mystery-box.selected {
  transition: none;
}

.superpops-mystery-transition-surface {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  transform-origin: 0 0;
  pointer-events: none;
  z-index: 0;
}

.superpops-mystery-area.is-revealed .superpops-mystery-box.selected {
  transform: none;
}

.superpops-mystery-area.is-revealed .superpops-mystery-box .superpops-gift-body {
  opacity: 1;
  transform: translateY(4px);
}

.superpops-mystery-area.is-revealed .superpops-box-lid.open {
  transform: translate(-6px, -28px) rotate(-9deg);
  opacity: 1;
}

/* Selection instructions have served their purpose once the prize appears. */
.superpops-popup--mystery-box:has(.superpops-mystery-area.is-revealed) #superpops-game-footer,
.superpops-popup--mystery-box:has(.superpops-mystery-area.is-revealed) #superpops-game-header .superpops-block-text {
  display: none;
}

.superpops-popup--mystery-box:has(.superpops-mystery-area.is-revealed) #superpops-game-header {
  margin-bottom: 0;
}

.superpops-mystery-area.is-revealed .not-selected {
  display: none;
}

.superpops-mystery-area.is-revealed .superpops-box-content {
  display: none;
}

.superpops-mystery-reward:not([hidden]) {
  display: block;
  width: 100%;
  max-width: 320px;
  margin: 2px auto 0;
  border: none;
  background: transparent;
}

.superpops-mystery-reward.is-win {
  color: #1a1a1a;
}

.superpops-mystery-reward .superpops-box-prize {
  display: block;
  padding: 4px 8px 8px;
  color: #1a1a1a;
  text-align: center;
}

.superpops-mystery-reward .superpops-prize-icon {
  display: none;
}

.superpops-mystery-reward .superpops-prize-text {
  min-width: 0;
  font-size: 32px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.025em;
  overflow-wrap: anywhere;
}

.superpops-mystery-reward.is-custom .superpops-prize-text,
.superpops-mystery-reward:not(.is-win) .superpops-prize-text {
  font-size: 22px;
  line-height: 1.3;
}

/* Keep the claim form reachable with a short viewport or the keyboard open. */
.superpops-popup--mystery-box .superpops-main-content {
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  padding: 4px 4px 10px;
}

.superpops-popup--mystery-box .superpops-main-content > * {
  flex-shrink: 0;
}

.superpops-popup--mystery-box .superpops-form--block {
  width: 100%;
  max-width: 360px;
  margin: 0 auto;
}

.superpops-mystery-header {
  text-align: center;
  margin-bottom: 14px;
}

.superpops-mystery-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: var(--brand-color, #7B61FF);
  color: white;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
  animation: badgePop 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

.superpops-mystery-badge svg {
  width: 14px;
  height: 14px;
}

.superpops-mystery-subtitle {
  font-size: 14px;
  color: #4B5563;
  margin: 0;
  line-height: 1.4;
}

.superpops-hint-spinner {
  animation: spin 1s linear infinite;
}

.superpops-mystery-boxes {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px 16px;
  max-width: 300px;
  width: 100%;
  margin: 0 auto;
}

.superpops-mystery-box {
  aspect-ratio: 1.04;
  cursor: pointer;
  position: relative;
  transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  border: none;
  background: none;
  padding: 0;
  appearance: none;
}

@keyframes sp-box-arrive {
  from { opacity: 0; transform: translateY(10px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.superpops-mystery-box:hover:not(.selected):not(.not-selected) {
  transform: translateY(-4px);
}

.superpops-mystery-box.not-selected {
  opacity: 0.24;
  transform: scale(0.9);
}

.superpops-mystery-box.selected {
  transform: translateY(-5px) scale(1.08);
  z-index: 5;
}

/* Disabled prevents a second pick; it must not dim the selected prize. */
.superpops-mystery-area button.superpops-mystery-box.selected {
  opacity: 1;
  filter: none;
  animation: none;
}

.superpops-mystery-box:focus-visible,
.superpops-balloon:focus-visible,
.superpops-chest-tap:focus-visible,
.superpops-slot-spin:focus-visible,
.superpops-quiz-option:focus-visible,
.superpops-quiz-back:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--brand-color, #7B61FF) 32%, transparent);
  outline-offset: 3px;
}

.superpops-mystery-box.is-opening .superpops-gift-shell {
  animation: sp-box-opening 0.32s ease-in-out infinite alternate;
}

@keyframes sp-box-opening {
  from { transform: translateY(0) rotate(-1.5deg); }
  to { transform: translateY(-3px) rotate(1.5deg); }
}

.superpops-box-inner {
  position: absolute;
  inset: 0;
  overflow: visible;
  animation: sp-box-arrive 0.44s cubic-bezier(0.2, 0.8, 0.2, 1) both;
  animation-delay: var(--box-delay, 0ms);
}

.superpops-box-shadow {
  position: absolute;
  bottom: 4%;
  left: 18%;
  right: 18%;
  height: 13%;
  background: radial-gradient(ellipse, rgba(17, 24, 39, 0.2) 0%, transparent 70%);
  border-radius: 50%;
  filter: blur(2px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.superpops-mystery-box.selected .superpops-box-shadow {
  opacity: 0.65;
  transform: scaleX(0.82);
}

.superpops-gift-shell {
  position: absolute;
  inset: 6%;
  z-index: 2;
  filter: drop-shadow(0 10px 12px color-mix(in srgb, var(--brand-color, #7B61FF) 22%, transparent));
  transform-origin: 50% 78%;
}

.superpops-gift-body {
  position: absolute;
  left: 12%;
  bottom: 12%;
  width: 76%;
  height: 52%;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--brand-color, #7B61FF) 78%, #111827);
  border-radius: 8px 8px 14px 14px;
  background:
    linear-gradient(105deg, rgba(255, 255, 255, 0.2) 0 15%, transparent 15% 100%),
    linear-gradient(145deg, color-mix(in srgb, var(--brand-color, #7B61FF) 88%, white), var(--brand-color, #7B61FF));
  box-shadow: inset -12px -10px 18px color-mix(in srgb, var(--brand-color, #7B61FF) 80%, #111827);
  transition: opacity 0.35s ease, transform 0.45s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.superpops-gift-ribbon,
.superpops-gift-lid-ribbon {
  position: absolute;
  left: 50%;
  width: 18%;
  height: 100%;
  transform: translateX(-50%);
  background: color-mix(in srgb, white 88%, var(--brand-color, #7B61FF));
  box-shadow: inset -3px 0 4px rgba(17, 24, 39, 0.09);
}

.superpops-box-lid {
  position: absolute;
  top: 27%;
  left: 7%;
  width: 86%;
  height: 21%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid color-mix(in srgb, var(--brand-color, #7B61FF) 78%, #111827);
  border-radius: 9px;
  background: linear-gradient(145deg, color-mix(in srgb, var(--brand-color, #7B61FF) 84%, white), var(--brand-color, #7B61FF));
  box-shadow: 0 5px 9px rgba(17, 24, 39, 0.17);
  transform-origin: 25% 85%;
  transition: opacity 0.36s ease, transform 0.52s cubic-bezier(0.2, 0.9, 0.2, 1.1);
  z-index: 3;
}

.superpops-gift-lid-ribbon {
  top: 0;
}

.superpops-gift-bow {
  position: absolute;
  bottom: 72%;
  width: 30%;
  height: 92%;
  border: 5px solid color-mix(in srgb, white 88%, var(--brand-color, #7B61FF));
  background: color-mix(in srgb, white 16%, transparent);
}

.superpops-gift-bow--left {
  right: 48%;
  border-radius: 85% 38% 52% 72%;
  transform: rotate(19deg);
}

.superpops-gift-bow--right {
  left: 48%;
  border-radius: 38% 85% 72% 52%;
  transform: rotate(-19deg);
}

.superpops-box-lid.open {
  transform: translate(-10px, -42px) rotate(-11deg);
  opacity: 1;
}

.superpops-box-content {
  position: absolute;
  top: 15%;
  left: 9%;
  width: 82%;
  height: 68%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid color-mix(in srgb, var(--brand-color, #7B61FF) 72%, #111827);
  border-radius: 14px;
  opacity: 0;
  transform: translateY(18px) scale(0.88);
  box-shadow: 0 12px 25px color-mix(in srgb, var(--brand-color, #7B61FF) 28%, transparent);
  z-index: 1;
}

.superpops-box-content.revealed {
  opacity: 1;
  z-index: 4;
  animation: revealBounce 0.48s cubic-bezier(0.2, 0.9, 0.2, 1.08) both;
}

@keyframes revealBounce {
  0% { transform: translateY(18px) scale(0.86); opacity: 0; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}

@keyframes scaleIn {
  0% { transform: scale(0.75); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.superpops-box-content.win {
  background: linear-gradient(135deg, var(--brand-color, #7B61FF) 0%, color-mix(in srgb, var(--brand-color, #7B61FF) 70%, black) 100%);
}

.superpops-box-content.lose {
  border-color: #D1D5DB;
  background: linear-gradient(145deg, #9CA3AF 0%, #6B7280 100%);
  box-shadow: 0 12px 25px rgba(17, 24, 39, 0.18);
}

.superpops-mystery-box.is-revealed .superpops-gift-body {
  opacity: 1;
  transform: translateY(11px) scaleX(0.95);
}

.superpops-box-prize {
  text-align: center;
  color: white;
  padding: 12px;
}

.superpops-prize-icon {
  display: grid;
  width: 34px;
  height: 34px;
  margin: 0 auto 7px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  font-size: 20px;
}

.superpops-prize-text {
  font-size: 13px;
  font-weight: 700;
  word-break: break-word;
  letter-spacing: 0.5px;
}

/* Restrained, brand-colored particles for a winning reveal. */
.superpops-box-particle {
  position: absolute;
  top: 47%;
  left: 50%;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand-color, #7B61FF);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand-color, #7B61FF) 18%, transparent);
  pointer-events: none;
  animation: sp-box-particle 0.85s cubic-bezier(0.1, 0.7, 0.2, 1) var(--particle-delay, 0ms) both;
  z-index: 8;
}

.superpops-box-particle--spark {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: color-mix(in srgb, white 78%, var(--brand-color, #7B61FF));
  transform: rotate(45deg);
}

@keyframes sp-box-particle {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0); }
  18% { opacity: 1; }
  100% { opacity: 0; transform: translate(calc(-50% + var(--particle-x)), calc(-50% + var(--particle-y))) scale(0.35) rotate(135deg); }
}

/* Custom image overrides for mystery box */
.superpops-box-custom-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.superpops-gift-shell--custom {
  inset: 8%;
}

.superpops-mystery-box.has-custom-image .superpops-box-lid {
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.superpops-mystery-box.has-custom-image .superpops-box-lid.open {
  /* Custom artwork is the entire prize, not a detachable lid. */
  transform: none;
  opacity: 1;
}


/* ============================================================================
   MEMORY MATCH GAME SPECIFIC STYLES
   ============================================================================ */

.memory-game {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.memory-header {
  text-align: center;
  margin-bottom: 12px;
}

.memory-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: var(--brand-color, #7B61FF);
  color: white;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  animation: badgePop 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

.memory-badge svg {
  width: 14px;
  height: 14px;
}

.memory-stats {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 12px;
  width: 100%;
}

.memory-stat {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: #f8f9fa;
  padding: 8px 12px;
  border-radius: 8px;
}

.memory-stat svg {
  flex-shrink: 0;
  color: #4B5563;
}

.memory-stat--time svg {
  color: #4B5563;
}

.memory-stat--flips svg {
  color: #4B5563;
}

.memory-stat--pairs {
  background: color-mix(in srgb, var(--brand-color, #7B61FF) 10%, white);
}

.memory-stat--pairs svg {
  color: var(--brand-color, #7B61FF);
}

.memory-stat-value {
  font-size: 14px;
  font-weight: 700;
  color: #333;
}

.memory-stat--pairs .memory-stat-value {
  color: var(--brand-color, #7B61FF);
}

.memory-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  width: 100%;
  max-width: 320px;
  margin: 0 auto;
}

.memory-card {
  aspect-ratio: 1;
  cursor: pointer;
  position: relative;
}

.memory-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  transform-style: preserve-3d;
}

.memory-card.flipped .memory-card-inner,
.memory-card.matched .memory-card-inner {
  transform: rotateY(180deg);
}

.memory-card-front,
.memory-card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
}

.memory-card-front {
  background: linear-gradient(145deg, var(--brand-color, #7B61FF) 0%, color-mix(in srgb, var(--brand-color, #7B61FF) 80%, black) 100%);
  color: rgba(255, 255, 255, 0.9);
  font-weight: 700;
  font-size: 20px;
  box-shadow: 0 2px 8px color-mix(in srgb, var(--brand-color, #7B61FF) 30%, transparent);
  z-index: 2;
}

.memory-card-back {
  background: white;
  transform: rotateY(180deg);
  border: 2px solid #e5e7eb;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.memory-card:hover:not(.matched):not(.flipped) .memory-card-inner {
  transform: scale(1.05);
}

.memory-card:hover:not(.matched):not(.flipped) .memory-card-front {
  box-shadow: 0 4px 12px color-mix(in srgb, var(--brand-color, #7B61FF) 40%, transparent);
}

.memory-card.matched .memory-card-back {
  background: color-mix(in srgb, var(--brand-color, #7B61FF) 10%, white);
  border-color: var(--brand-color, #7B61FF);
  animation: matchPulse 0.4s ease;
}

@keyframes matchPulse {
  0%, 100% { transform: rotateY(180deg) scale(1); }
  50% { transform: rotateY(180deg) scale(1.08); }
}

/* Reduced-motion respect (WEB-2014 Tier 1):
   Memory match — instant flip, no match-pulse animation. Gameplay loop
   (click two cards, find pairs) is unchanged; only the motion duration
   is zeroed. */
@media (prefers-reduced-motion: reduce) {
  .memory-card-inner {
    transition: none;
  }
  .memory-card.matched .memory-card-back {
    animation: none;
  }
}

/* ============================================================================
   BLOCK-BASED SCREEN RENDERER
   ============================================================================ */

/* Game screen header (title + description above game) */
#superpops-game-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
  margin-bottom: 20px;
}

/* Game screen footer (hint/caption blocks below game) */
#superpops-game-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
  margin-top: 12px;
}

.superpops-screen-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
  width: 100%;
}

/* Ensure win screen content renders above confetti canvas */
.superpops-success-container .superpops-screen-content {
  position: relative;
  z-index: 2;
}

.superpops-block-heading {
  font-size: var(--heading-font-size, 24px);
  font-weight: 700;
  color: #1a1a1a;
  margin: 0;
  text-align: center;
}

.superpops-block-text {
  font-size: var(--body-font-size, 16px);
  color: #4B5563;
  margin: 0;
}

.superpops-block-tooltip {
  font-size: 14px;
  color: #6B7280;
  margin: 2px 0 4px;
  text-align: center;
  line-height: 1.4;
  max-width: 320px;
}

.superpops-block-icon {
  font-size: 48px;
  line-height: 1;
  text-align: center;
  width: 100%;
}

.superpops-block-artwork {
  position: relative;
  display: grid;
  place-items: center;
  inline-size: 80px;
  block-size: 80px;
  margin-inline: auto;
  pointer-events: none;
}

.superpops-block-artwork-image {
  display: block;
  max-width: 80px;
  max-height: 80px;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.superpops-block-artwork-emoji {
  font-size: 44px;
  line-height: 1;
}

@media (max-width: 480px) {
  .superpops-block-artwork {
    inline-size: 64px;
    block-size: 64px;
  }

  .superpops-block-artwork-image {
    max-width: 64px;
    max-height: 64px;
  }
}

.superpops-block-discount {
  font-size: 34px;
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: var(--brand-color, #7B61FF);
  margin: 2px 0 6px;
}

.superpops-success-container .superpops-block-heading {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #6B7280;
}

.superpops-success-container .superpops-block-icon {
  font-size: 44px;
}

.superpops-win-reveal .superpops-block-artwork {
  animation: superpops-artwork-reveal 420ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.superpops-win-reveal .superpops-block-discount {
  animation: superpops-reward-reveal 360ms 90ms ease-out both;
}

@keyframes superpops-artwork-reveal {
  from {
    opacity: 0;
    transform: scale(0.82) translateY(4px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes superpops-reward-reveal {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes superpops-safe-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .superpops-win-reveal .superpops-block-artwork,
  .superpops-win-reveal .superpops-block-discount {
    animation: superpops-safe-fade 120ms linear both !important;
  }
}

.superpops-form-field {
  width: 100%;
}

.superpops-input-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: #374151;
  margin-bottom: 4px;
}

.superpops-form-field .superpops-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--input-border-color, #ccc);
  border-radius: var(--input-border-radius, 8px);
  font-size: var(--body-font-size, 16px);
  font-family: var(
    --font-family,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    "Helvetica Neue",
    Arial,
    sans-serif
  ) !important;
  text-align: left !important;
  background: #fff;
  outline: none;
  box-sizing: border-box;
}

.superpops-form-field .superpops-input:focus {
  border-color: var(--input-focus-color, var(--brand-color, #7B61FF));
  box-shadow: 0 0 0 2px rgba(123, 97, 255, 0.15);
}

/* ============================================================================
   RESPONSIVE DESIGN
   ============================================================================ */

@media (max-width: 720px) {
  /* Convert side layouts to top layout on medium screens */
  .superpops-popup--left_image,
  .superpops-popup--right_image {
    max-width: 480px;
  }

  .superpops-popup--left_image .superpops-content,
  .superpops-popup--right_image .superpops-content {
    flex-direction: column;
  }

  .superpops-popup--left_image .superpops-layout-image,
  .superpops-popup--right_image .superpops-layout-image {
    width: 100%;
    height: 160px;
    min-height: unset;
    order: unset;
    border-radius: 16px 16px 0 0;
  }

  .superpops-popup--left_image .superpops-main-content,
  .superpops-popup--right_image .superpops-main-content {
    order: unset;
    padding: 20px 18px 16px;
  }
}

@media (max-width: 600px) {
  .superpops-popup {
    border-radius: 16px;
    max-height: 92vh;
    max-width: 360px;
  }

  /* Reduce image height on mobile */
  .superpops-popup--top_image .superpops-layout-image,
  .superpops-popup--left_image .superpops-layout-image,
  .superpops-popup--right_image .superpops-layout-image {
    height: 140px;
  }

  .superpops-popup--top_image,
  .superpops-popup--left_image,
  .superpops-popup--right_image {
    max-width: 360px;
  }

  .superpops-content {
    padding: 20px 18px 16px;
  }

  .superpops-title {
    font-size: 20px;
    margin-bottom: 12px;
  }

  /* Minimalist success/lose mobile styles */
  .superpops-success-container,
  .superpops-lose-container {
    padding: 24px 20px;
    min-height: 240px;
  }

  .superpops-success-container {
    padding-inline: 0;
  }

  .superpops-success-emoji {
    font-size: 48px;
  }

  .superpops-success-title {
    font-size: 24px;
  }

  .superpops-success-prize {
    font-size: 18px;
  }

  .superpops-code-box {
    min-height: 52px;
    padding: 11px 14px;
  }

  .superpops-code-box .superpops-code-display {
    font-size: 15px;
    letter-spacing: 1.5px;
  }

  .superpops-block-discount {
    font-size: 30px;
  }

  .superpops-lose-emoji {
    font-size: 40px;
  }

  .superpops-lose-title {
    font-size: 20px;
  }

  .superpops-button--success,
  .superpops-button--lose {
    padding: 12px 28px;
    font-size: 14px;
  }

  /* Scratch card mobile */
  .superpops-scratch-area {
    max-width: 280px;
  }

  .superpops-scratch-result-badge {
    font-size: 40px;
  }

  .superpops-scratch-result-title {
    font-size: 18px;
  }

  .superpops-scratch-result-prize {
    font-size: 24px;
  }

  .superpops-wheel-area {
    max-width: none;
  }

  .superpops-wheel-stage {
    width: min(100%, 256px);
    padding: 7px;
  }

  .superpops-wheel-pointer {
    top: -8px;
    width: 22px;
    height: 29px;
  }

  .superpops-wheel-center-cap {
    width: 42px;
    height: 42px;
  }

  .superpops-wheel-center-mark {
    width: 14px;
    height: 14px;
  }

  .superpops-spin-button {
    max-width: 250px;
    padding: 12px 20px;
    font-size: 14px;
  }

  .superpops-mystery-boxes {
    gap: 10px;
    max-width: 280px;
  }

  .superpops-box-emoji {
    font-size: 36px;
  }

  .superpops-prize-icon {
    font-size: 28px;
  }

  .superpops-prize-text {
    font-size: 11px;
  }

  .superpops-mystery-subtitle {
    font-size: 13px;
  }

  .superpops-form-icon {
    font-size: 32px;
  }

  .superpops-form-title {
    font-size: 18px;
  }

  .superpops-input {
    padding: 10px 12px;
    font-size: 14px;
  }

  .superpops-button {
    padding: 10px 16px;
    font-size: 14px;
  }

  /* Minimal form mobile */
  .superpops-form-content {
    padding: 12px 0;
  }

  .superpops-form-emoji {
    font-size: 40px;
  }

  .superpops-form-heading {
    font-size: 20px;
  }

  .superpops-form-subtext {
    font-size: 14px;
    margin-bottom: 16px;
  }

  .superpops-input--minimal {
    padding: 12px 14px;
    font-size: 14px;
  }

  .superpops-button--claim {
    padding: 12px 28px;
    font-size: 14px;
  }

  .memory-grid {
    gap: 6px;
    max-width: 280px;
  }

  .memory-card-front,
  .memory-card-back {
    font-size: 22px;
    border-radius: 8px;
  }

  .memory-stat {
    padding: 6px 10px;
  }

  .memory-stat-icon {
    font-size: 12px;
  }

  .memory-stat-value {
    font-size: 12px;
  }
}

@media (max-width: 480px) {
  .memory-grid {
    gap: 6px;
  }

  .memory-card-front,
  .memory-card-back {
    font-size: 20px;
  }

  .memory-stat-value {
    font-size: 13px;
  }
}

@media (max-width: 400px) {
  .superpops-scratch-area {
    max-width: 240px;
  }

  .superpops-mystery-boxes {
    gap: 8px;
    max-width: 260px;
  }

  .superpops-box-emoji {
    font-size: 32px;
  }

  .superpops-prize-icon {
    font-size: 24px;
  }

  .superpops-prize-text {
    font-size: 10px;
  }
}

@media (max-width: 380px) {
  .memory-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ============================================================================
   ACCESSIBILITY
   ============================================================================ */

.superpops-input:focus-visible,
.superpops-button:focus-visible,
.superpops-close:focus-visible {
  outline: 3px solid var(--brand-color, #7B61FF);
  outline-offset: 2px;
}

/* ============================================================================
   PRINT STYLES
   ============================================================================ */

@media print {
  .superpops-overlay {
    display: none;
  }
}

/* ============================================================================
   PREVENT BODY SCROLL WHEN POPUP IS OPEN
   ============================================================================ */

body:has(.superpops-overlay) {
  overflow: hidden;
}

/* ============================================================================
   REDUCED MOTION
   ============================================================================ */

@media (prefers-reduced-motion: reduce) {
  .superpops-overlay,
  .superpops-popup,
  .superpops-overlay *,
  .superpops-overlay *::before,
  .superpops-overlay *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============================================================================
   STANDALONE MODE (/play route)
   Overrides fixed overlay positioning when popup is embedded in a page
   ============================================================================ */

.superpops-overlay.superpops-standalone {
  position: static;
  background: transparent;
  backdrop-filter: none;
  display: block;
  z-index: auto;
  padding: 0;
  opacity: 1;
  transition: none;
}

.superpops-overlay.superpops-standalone .superpops-popup {
  max-width: 100%;
  width: 100%;
  animation: none;
}

/* Hide close button in standalone mode — no overlay to dismiss */
.superpops-overlay.superpops-standalone .superpops-close {
  display: none;
}

/* ============================================================================
   RE-OPEN FAB (WEB-2028 adjacent)
   Storefront floating button shown after dismiss-without-play.
   Theme-block-configurable: position / label / icon / colors / shape.
   ============================================================================ */

.superpops-reopen-fab {
  position: fixed;
  z-index: 999998; /* below popup overlay (999999) so popup wins when both open */
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px 10px 12px;
  background: var(--brand-color, #7B61FF);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.18);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  animation: superpopsReopenFabIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.superpops-reopen-fab:hover { transform: scale(1.04); }
.superpops-reopen-fab:focus-visible {
  outline: 3px solid #005bd3;
  outline-offset: 3px;
}

.superpops-reopen-fab-icon { font-size: 18px; line-height: 1; }
.superpops-reopen-fab-label { line-height: 1.2; }

/* Position variants */
.superpops-reopen-fab--bottom-right { bottom: 20px; right: 20px; }
.superpops-reopen-fab--bottom-left  { bottom: 20px; left: 20px; }
.superpops-reopen-fab--top-right    { top: 20px; right: 20px; }
.superpops-reopen-fab--top-left     { top: 20px; left: 20px; }

/* Shape variants */
.superpops-reopen-fab--shape-pill { border-radius: 28px; }
.superpops-reopen-fab--shape-rounded { border-radius: 8px; }
.superpops-reopen-fab--shape-square { border-radius: 0; }

@keyframes superpopsReopenFabIn {
  from { opacity: 0; transform: translateY(8px) scale(0.92); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .superpops-reopen-fab {
    animation: none;
  }
}

@media (max-width: 480px) {
  .superpops-reopen-fab .superpops-reopen-fab-label { display: none; }
  .superpops-reopen-fab { padding: 10px; gap: 0; }
}

/* ============================================================================
   IDLE-PULSE CTA — gentle invitation when popup has been idle for 3s
   ============================================================================

   Two layered animations, both running 1.5s × 3 = 4.5s total:

   1. CTA glow — brand-color box-shadow blooms outward (0px → 14px) and
      fades to transparent. Applied to the primary action element(s).

   2. Backdrop breathing — overlay opacity nudges 0.7 → 0.74 → 0.7.
      Almost imperceptible per pulse but quietly draws focus toward the
      popup. Applied to .superpops-overlay.

   CSS handles the 3-iteration auto-stop. Suppressed entirely under
   prefers-reduced-motion: reduce.
*/

@keyframes superpopsIdlePulse {
  0%   { box-shadow: 0 0 0 0 var(--brand-color); }
  100% { box-shadow: 0 0 0 14px transparent; }
}

@keyframes superpopsIdleBackdropPulse {
  0%, 100% { background: rgba(0, 0, 0, 0.70); }
  50%      { background: rgba(0, 0, 0, 0.74); }
}

.superpops-idle-pulse {
  animation: superpopsIdlePulse 1.5s ease-out 3;
}

.superpops-overlay.superpops-idle-pulse-bg {
  animation: superpopsIdleBackdropPulse 1.5s ease-in-out 3;
}

@media (prefers-reduced-motion: reduce) {
  .superpops-idle-pulse,
  .superpops-overlay.superpops-idle-pulse-bg {
    animation: none;
  }
}

/* ============================================================================
   BOTTOM-SHEET LAYOUT — mobile bottom sheet, falls back to modal on ≥768px
   ============================================================================

   Mobile (≤767px):
     - Sheet pinned to bottom edge of viewport
     - 90vh max-height; content scrolls inside
     - 20px border-radius at top corners only
     - 350ms cubic-bezier slide-up entrance
     - Drag handle visible, X button hidden
     - Primary CTA naturally pins to sheet bottom via flex (thumb zone)

   Desktop (≥768px):
     - All rules in @media block don't apply
     - Popup keeps existing modal styling (centered, max-width 420px, X visible)
     - Drag handle hidden via the default .superpops-drag-handle rule below
*/

.superpops-drag-handle {
  display: none;
  width: 44px;
  height: 4px;
  background: rgba(0, 0, 0, 0.18);
  border-radius: 2px;
  margin: 12px auto 0;
  flex-shrink: 0;
  cursor: grab;
  touch-action: none;
}

@media (max-width: 767px) {
  .superpops-popup--bottom_sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    margin: 0;
    width: 100%;
    max-width: none;
    max-height: 90vh;
    border-radius: 20px 20px 0 0;
    animation: superpopsBottomSheetIn 350ms cubic-bezier(0.22, 1, 0.36, 1);
    display: flex;
    flex-direction: column;
  }

  .superpops-popup--bottom_sheet .superpops-close {
    display: none;
  }

  .superpops-popup--bottom_sheet .superpops-drag-handle {
    display: block;
  }

  .superpops-popup--bottom_sheet .superpops-content {
    flex: 1;
    overflow-y: auto;
  }
}

@keyframes superpopsBottomSheetIn {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .superpops-popup--bottom_sheet {
    animation: none;
  }
}

/* ============================================================================
   COUNTDOWN BLOCK — mirrors the actual Shopify code expiry
   ============================================================================ */

.superpops-block-countdown {
  font-size: 14px;
  color: #6B7280;
  text-align: center;
  margin: 8px 0;
}

.superpops-countdown-timer {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--brand-color);
}

.superpops-block-countdown--expired {
  color: #9CA3AF;
}

.superpops-countdown-expired {
  font-weight: 600;
}

.superpops-code--expired {
  text-decoration: line-through;
  opacity: 0.5;
}

.superpops-code-box.superpops-copy-btn--expired {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

/* ============================================================================
   TAP-TO-OPEN CHEST (inlined from chest.css — see header)
   Namespaced under .superpops-chest-* to avoid collisions with other games.
   ============================================================================ */

.superpops-chest-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 8px 0;
  width: 100%;
  box-sizing: border-box;
  text-align: center;
  user-select: none;
}

.superpops-chest-tap {
  display: grid;
  place-items: center;
  width: 100%;
  padding: 2px 0 0;
  cursor: pointer;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
}

.superpops-chest-stage {
  position: relative;
  display: grid;
  width: 230px;
  height: 220px;
  place-items: center;
}
.superpops-chest-tap.is-open,
.superpops-chest-tap:disabled {
  cursor: default;
  opacity: 1;
}

/* Wobble wrapper — chest SVG lives inside but the lid <g> transition is
   driven separately so it is never interrupted by the wobble replay. */
.superpops-chest-wobble {
  display: inline-block;
  position: relative;
  z-index: 2;
  will-change: transform;
}

.superpops-chest-lid {
  transform-origin: 120px 120px;
  transition: transform 0.65s cubic-bezier(0.34, 1.4, 0.5, 1);
  will-change: transform;
}

.superpops-chest-glow,
.superpops-chest-beams {
  transform-origin: 120px 140px;
}

.superpops-chest-dots {
  display: flex;
  gap: 6px;
  justify-content: center;
  width: 132px;
}

.superpops-chest-dot {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--brand-color, #7b61ff) 14%, #E5E7EB);
  transition: background 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}

.superpops-chest-dot.is-done {
  background: var(--brand-color, #7b61ff);
}

.superpops-chest-dot.is-next {
  background: color-mix(in srgb, var(--brand-color, #7b61ff) 42%, #E5E7EB);
  transform: scaleY(1.34);
  box-shadow: 0 2px 8px color-mix(in srgb, var(--brand-color, #7b61ff) 24%, transparent);
}

.superpops-chest-copy {
  text-align: center;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.02em;
  color: #1a1a1a;
}

.superpops-chest-reward {
  position: absolute;
  top: 74px;
  left: 50%;
  z-index: 1;
  display: grid;
  min-width: 108px;
  min-height: 62px;
  padding: 9px 14px;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--brand-color, #7B61FF) 76%, #111827);
  border-radius: 15px;
  background: linear-gradient(145deg, color-mix(in srgb, var(--brand-color, #7B61FF) 88%, white), var(--brand-color, #7B61FF));
  box-shadow: 0 10px 24px color-mix(in srgb, var(--brand-color, #7B61FF) 28%, transparent);
  color: #ffffff;
  opacity: 0;
  transform: translate(-50%, 20px) scale(0.86);
  transition: opacity 0.25s ease, transform 0.5s cubic-bezier(0.2, 0.9, 0.2, 1.08);
}

.superpops-chest-reward.is-visible {
  opacity: 1;
  transform: translate(-50%, -52px) scale(1);
}

.superpops-chest-reward-mark {
  display: grid;
  width: 24px;
  height: 24px;
  margin-bottom: 4px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  font-size: 13px;
}

.superpops-chest-reward-text {
  max-width: 116px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.035em;
  line-height: 1.15;
}

.superpops-chest-tap.is-open .superpops-chest-lock {
  opacity: 0;
  transform: scale(0.6);
}

.superpops-chest-lock {
  transform-box: fill-box;
  transform-origin: center;
  transition: opacity 0.2s ease, transform 0.3s ease;
}

@keyframes sp-chest-wobble {
  0% {
    transform: translate(0, 0) rotate(0);
  }
  15% {
    transform: translate(-2px, -4px) rotate(-3deg);
  }
  35% {
    transform: translate(2px, -2px) rotate(3deg);
  }
  55% {
    transform: translate(-1px, -1px) rotate(-2deg);
  }
  75% {
    transform: translate(1px, 0) rotate(1deg);
  }
  100% {
    transform: translate(0, 0) rotate(0);
  }
}

@keyframes sp-chest-pulse {
  0%,
  100% {
    opacity: 0.6;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.06);
  }
}

@keyframes sp-chest-spark {
  0%,
  100% {
    opacity: 0.5;
    transform: translateY(0);
  }
  50% {
    opacity: 1;
    transform: translateY(-3px);
  }
}

.superpops-chest-glow {
  animation: sp-chest-pulse 1.4s ease-in-out infinite;
}

.superpops-chest-beams {
  animation: sp-chest-pulse 1s ease-in-out infinite;
}

.superpops-chest-spark {
  animation: sp-chest-spark 1.8s ease-in-out infinite;
}

/* Final tap: the lid pops loose and is thrown off the top of the chest. */
@keyframes sp-chest-lid-throw {
  0% {
    transform: translateY(0) rotate(-22deg);
    opacity: 1;
  }
  22% {
    transform: translateY(-28px) rotate(-34deg) scale(1.06);
    opacity: 1;
  }
  100% {
    transform: translateY(-185px) rotate(30deg) scale(0.7);
    opacity: 0;
  }
}

.superpops-chest-lid.superpops-chest-thrown {
  animation: sp-chest-lid-throw 0.7s cubic-bezier(0.3, 0.7, 0.4, 1) forwards;
}

@media (prefers-reduced-motion: reduce) {
  .superpops-chest-lid {
    transition: none;
  }
  .superpops-chest-lid.superpops-chest-thrown {
    animation: none;
  }
  .superpops-chest-glow,
  .superpops-chest-beams,
  .superpops-chest-spark,
  .superpops-chest-reward {
    animation: none;
    transition: none;
  }
}

/* SLOT MACHINE (inlined from slot-machine.css) */

.superpops-slot-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 13px;
  width: 100%;
  box-sizing: border-box;
  padding: 8px 0 5px;
}

.superpops-slot-machine {
  position: relative;
  width: min(100%, 316px);
  padding: 15px 12px 13px;
  box-sizing: border-box;
  border: 1px solid color-mix(in srgb, var(--brand-color, #7b61ff) 18%, #252832);
  border-radius: 20px;
  background:
    radial-gradient(circle at 50% -20%, color-mix(in srgb, var(--brand-color, #7b61ff) 20%, transparent), transparent 46%),
    linear-gradient(155deg, #20222a, #111318 72%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    inset 0 -1px 0 rgba(0, 0, 0, 0.65),
    0 16px 30px rgba(15, 23, 42, 0.18);
  transition: border-color 220ms ease, box-shadow 220ms ease;
}

.superpops-slot-marquee {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin: 0 7px 12px;
  color: #f8fafc;
}

.superpops-slot-marquee span {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.13em;
  line-height: 1;
  text-transform: uppercase;
}

.superpops-slot-marquee strong {
  color: rgba(248, 250, 252, 0.5);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.04em;
}

.superpops-slot-reel-deck {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  min-width: 0;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 12px;
  background: #090a0d;
  overflow: hidden;
  box-shadow:
    inset 0 2px 10px rgba(0, 0, 0, 0.8),
    0 1px 0 rgba(255, 255, 255, 0.04);
}

.superpops-slot-payline {
  position: absolute;
  z-index: 4;
  top: 72px;
  left: 4px;
  right: 4px;
  height: 64px;
  box-sizing: border-box;
  border-top: 1px solid color-mix(in srgb, var(--brand-color, #7b61ff) 62%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--brand-color, #7b61ff) 62%, transparent);
  background: color-mix(in srgb, var(--brand-color, #7b61ff) 8%, transparent);
  box-shadow:
    inset 0 0 20px color-mix(in srgb, var(--brand-color, #7b61ff) 8%, transparent),
    0 0 16px color-mix(in srgb, var(--brand-color, #7b61ff) 8%, transparent);
  pointer-events: none;
  transition: background 220ms ease, border-color 220ms ease, box-shadow 220ms ease;
}

/* Each reel shows three rows; the server-selected result lands in row two. */
.superpops-slot-reel {
  position: relative;
  z-index: 1;
  width: 100%;
  min-width: 0;
  height: 192px;
  border-left: 1px solid rgba(255, 255, 255, 0.07);
  border-right: 1px solid rgba(255, 255, 255, 0.07);
  background: linear-gradient(180deg, #101217, #191c23 50%, #101217);
  border-radius: 5px;
  overflow: hidden;
  box-shadow: inset 0 0 14px rgba(0, 0, 0, 0.52);
  transition: border-color 180ms ease, box-shadow 180ms ease, opacity 180ms ease;
}

.superpops-slot-reel::before,
.superpops-slot-reel::after {
  content: "";
  position: absolute;
  z-index: 3;
  left: 0;
  right: 0;
  height: 54px;
  pointer-events: none;
}

.superpops-slot-reel::before {
  top: 0;
  background: linear-gradient(180deg, rgba(9, 10, 13, 0.88), transparent);
}

.superpops-slot-reel::after {
  bottom: 0;
  background: linear-gradient(0deg, rgba(9, 10, 13, 0.88), transparent);
}

.superpops-slot-strip {
  display: block;
  will-change: transform;
}

/* Cell height must stay in sync with SYM_H in slot-machine-game.js. */
.superpops-slot-sym {
  box-sizing: border-box;
  width: 100%;
  height: 64px;
  display: grid;
  place-items: center;
  color: var(--brand-color, #7b61ff);
  color: color-mix(in srgb, var(--brand-color, #7b61ff) 82%, white);
  opacity: 0.76;
}

.superpops-slot-sym--target {
  color: var(--brand-color, #7b61ff);
  color: color-mix(in srgb, var(--brand-color, #7b61ff) 68%, white);
  opacity: 1;
}

.superpops-slot-sym-icon {
  display: block;
  width: 40px;
  height: 40px;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.34));
}

.superpops-slot-sym-img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.34));
}

.superpops-slot-reel.is-spinning .superpops-slot-strip {
  filter: blur(1.6px) saturate(0.78);
}

.superpops-slot-reel.is-stopped {
  box-shadow:
    inset 0 0 14px rgba(0, 0, 0, 0.52),
    0 0 0 1px color-mix(in srgb, var(--brand-color, #7b61ff) 24%, transparent);
}

.superpops-slot-machine.is-win {
  border-color: color-mix(in srgb, var(--brand-color, #7b61ff) 54%, #252832);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 16px 32px color-mix(in srgb, var(--brand-color, #7b61ff) 24%, rgba(15, 23, 42, 0.2));
}

.superpops-slot-machine.is-win .superpops-slot-payline {
  border-color: color-mix(in srgb, var(--brand-color, #7b61ff) 82%, white);
  background: color-mix(in srgb, var(--brand-color, #7b61ff) 18%, transparent);
  box-shadow:
    inset 0 0 24px color-mix(in srgb, var(--brand-color, #7b61ff) 16%, transparent),
    0 0 20px color-mix(in srgb, var(--brand-color, #7b61ff) 24%, transparent);
  animation: sp-slot-payline-win 420ms ease-out 2;
}

@keyframes sp-slot-payline-win {
  50% { opacity: 0.56; }
}

.superpops-slot-reel.is-settled {
  animation: sp-slot-bounce 0.24s cubic-bezier(0.22, 1, 0.36, 1) 1;
}

@keyframes sp-slot-bounce {
  0% { transform: translateY(0); }
  42% { transform: translateY(4px); }
  100% { transform: translateY(0); }
}

.superpops-slot-spin {
  max-width: 316px;
  min-height: 54px;
  padding: 13px 18px 13px 22px;
  font-weight: 800;
  font-size: 16px;
  letter-spacing: 0.02em;
  gap: 10px;
}

.superpops-slot-spin svg {
  width: 19px;
  height: 19px;
  fill: currentColor;
  transition: transform 180ms ease;
}

.superpops-slot-spin:hover:not(:disabled) svg { transform: rotate(45deg); }
.superpops-slot-spin:disabled { cursor: wait; }

.superpops-slot-status {
  min-height: 22px;
  margin: -2px 0 -4px;
  padding: 2px 6px;
  box-sizing: border-box;
  color: #6b7280;
  font-size: 12px;
  font-weight: 650;
  text-align: center;
}

.superpops-slot-status::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 7px;
  border-radius: 50%;
  background: var(--brand-color, #7b61ff);
  vertical-align: 1px;
}

@media (max-width: 390px) {
  .superpops-slot-machine { width: min(100%, 294px); padding-inline: 10px; }
  .superpops-slot-reel-deck { padding: 6px; }
  .superpops-slot-payline { top: 70px; }
  .superpops-slot-spin { max-width: 294px; }
  .superpops-slot-marquee { margin-inline: 5px; }
}

@media (prefers-reduced-motion: reduce) {
  .superpops-slot-reel.is-spinning .superpops-slot-strip { filter: none; }
  .superpops-slot-strip { transition: none !important; }
  .superpops-slot-reel.is-settled,
  .superpops-slot-machine.is-win .superpops-slot-payline { animation: none; }
  .superpops-slot-spin svg { transition: none; }
}

/* POP THE BALLOONS (inlined from pop-balloons.css) */

.superpops-balloon-area {
  position: relative;
  width: 100%;
  box-sizing: border-box;
  padding: 8px 0;
}

.superpops-balloon-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px 16px;
  justify-items: center;
  padding: 3px 4px 7px;
}

.superpops-balloon {
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 6px;
  width: 100%;
  max-width: 90px;
  aspect-ratio: 60 / 84;
  transform-origin: center bottom;
  transform: translate(var(--balloon-x, 0), var(--balloon-y, 0)) scale(var(--balloon-scale, 1));
  transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.superpops-balloon-svg {
  display: block;
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.15));
  transform-origin: center bottom;
  animation: sp-balloon-bob 2.8s ease-in-out var(--balloon-delay, 0s) infinite;
  transition: filter 0.25s ease;
}

.superpops-balloon:hover:not(.superpops-balloon-dim):not(.superpops-balloon-popped) {
  transform: translate(var(--balloon-x, 0), calc(var(--balloon-y, 0) - 5px)) scale(var(--balloon-scale, 1)) scale(1.04);
}

.superpops-balloon:hover:not(.superpops-balloon-dim):not(.superpops-balloon-popped) .superpops-balloon-svg {
  filter: drop-shadow(0 8px 10px color-mix(in srgb, var(--brand-color, #7B61FF) 22%, transparent));
}

.superpops-balloon-dim {
  opacity: 0.22;
  transform: translate(var(--balloon-x, 0), var(--balloon-y, 0)) scale(var(--balloon-scale, 1)) scale(0.9);
}

.superpops-balloon-dim .superpops-balloon-svg {
  animation: none;
}

/* Tapped balloon bursts: quick inflate -> snap/flash -> opacity drop. The
   latex fragments (spawned in JS) fly outward, and the celebration itself is
   the shared falling-confetti canvas (window.SuperPops.confetti). */
.superpops-balloon-popped {
  transform-origin: center;
}

.superpops-balloon-popped .superpops-balloon-svg {
  animation: sp-balloon-pop 0.45s cubic-bezier(0.3, 0, 0.2, 1) forwards;
}

/* Latex fragments flying outward from the burst point. */
.superpops-balloon-fragment {
  position: absolute;
  width: 10px;
  height: 10px;
  margin: -5px 0 0 -5px;
  border-radius: 60% 40% 55% 45%;
  pointer-events: none;
  z-index: 4;
  opacity: 0;
  animation: sp-balloon-fragment 0.55s ease-out forwards;
}

.superpops-balloon-result {
  position: absolute;
  z-index: 5;
  top: 50%;
  left: 50%;
  display: grid;
  min-width: 92px;
  min-height: 58px;
  max-width: 118px;
  padding: 9px 12px;
  place-items: center;
  border: 1px solid #E5E7EB;
  border-radius: 15px;
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(17, 24, 39, 0.16);
  color: #4B5563;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -42%) scale(0.92);
  transition: opacity 0.2s ease, transform 0.25s ease-out;
}

.superpops-balloon-result.is-visible {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.superpops-balloon-result.is-win {
  border-color: color-mix(in srgb, var(--brand-color, #7B61FF) 82%, #111827);
  background: linear-gradient(145deg, color-mix(in srgb, var(--brand-color, #7B61FF) 88%, white), var(--brand-color, #7B61FF));
  box-shadow: 0 10px 24px color-mix(in srgb, var(--brand-color, #7B61FF) 28%, transparent);
  color: #ffffff;
}

.superpops-balloon-result.is-lose {
  border-color: #D1D5DB;
  color: #4B5563;
}

@keyframes sp-balloon-bob {
  0%, 100% { transform: translateY(0) rotate(calc(var(--balloon-tilt, 0deg) - 1.5deg)); }
  50% { transform: translateY(-5px) rotate(calc(var(--balloon-tilt, 0deg) + 1.5deg)); }
}

@keyframes sp-balloon-pop {
  0% { transform: scale(1); opacity: 1; }
  30% { transform: scale(1.25); opacity: 1; }
  /* snap/flash at the moment of burst */
  45% { transform: scale(1.35); opacity: 1; filter: brightness(2.2); }
  60% { transform: scale(0.5); opacity: 0.4; filter: brightness(1); }
  100% { transform: scale(0.3); opacity: 0; }
}

@keyframes sp-balloon-fragment {
  0% { opacity: 1; transform: translate(0, 0) scale(1); }
  100% {
    opacity: 0;
    transform: translate(var(--dx, 30px), var(--dy, -30px)) scale(0.4);
  }
}

@media (prefers-reduced-motion: reduce) {
  .superpops-balloon-svg { animation: none; }
  /* Instant disappear, no burst keyframe or fragments. */
  .superpops-balloon-popped .superpops-balloon-svg { animation: none; opacity: 0; }
  .superpops-balloon-fragment { animation: none; display: none; }
}

/* ============================================================================
   FULLSCREEN TAKEOVER
   Composes with LEFT_IMAGE / RIGHT_IMAGE via .superpops-popup--fullscreen,
   added by game-loader.js when game.fullscreen is true. Keep this section at
   the end of the file so it wins the cascade over the responsive blocks above.
   ============================================================================ */

.superpops-overlay--fullscreen {
  padding: 0;
  background: transparent;
  backdrop-filter: none;
}

.superpops-popup.superpops-popup--fullscreen {
  width: 100vw;
  height: 100dvh;
  max-width: none;
  max-height: none;
  border-radius: 0;
  box-shadow: none;
  /* Spring-scale entrance looks wrong on a full-viewport element — fade instead */
  animation: popupFadeIn 0.3s ease-out;
}

/* No height rule on .superpops-content: it is already `flex: 1` and the
   free-plan branding footer is its SIBLING inside the flex-column popup —
   forcing height: 100% (= 100dvh) would push the branding past the popup's
   overflow: hidden edge and clip it. flex: 1 fills the remaining space
   correctly with or without the branding row. */
.superpops-popup--fullscreen .superpops-content {
  min-height: 0;
}

/* Desktop: 50/50 split — image fills one half, game centered in the other */
.superpops-popup--fullscreen .superpops-layout-image {
  width: 50%;
  height: auto;
  min-height: unset;
  border-radius: 0;
  align-self: stretch;
}

.superpops-popup--fullscreen .superpops-main-content {
  flex: 1;
  align-items: center;
  padding: 40px 32px;
  overflow-y: auto;
}

/* Vertical centering that degrades to scroll instead of clipping:
   flexible pseudo-spacers collapse to 0 when content overflows
   (justify-content: center would clip the top edge in a scroll container) */
.superpops-popup--fullscreen .superpops-main-content::before,
.superpops-popup--fullscreen .superpops-main-content::after {
  content: "";
  flex: 1 0 0;
}

.superpops-popup--fullscreen .superpops-main-content > * {
  width: 100%;
  max-width: 520px;
  flex-shrink: 0;
}

/* The game/form containers are `flex: 1` (basis 0) in their base rules — in a
   spacer-centered column that squeezes them to a fraction of their content
   height while the content overflows onto the footer. Size them to content;
   the pseudo-spacers above handle the centering. */
.superpops-popup--fullscreen .superpops-game-container,
.superpops-popup--fullscreen .superpops-form-container {
  flex: 0 0 auto;
}

/* No image uploaded (or image deleted): game centers in the full viewport,
   popup background fills the space — the image div simply isn't rendered */

/* Close button must stay visible over the image half */
.superpops-popup--fullscreen .superpops-close {
  top: max(16px, env(safe-area-inset-top));
  right: max(16px, env(safe-area-inset-right));
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}

.superpops-popup--fullscreen .superpops-close:hover {
  background: rgba(255, 255, 255, 1);
}

/* Free-plan branding footer pinned at the bottom, safe-area aware */
.superpops-popup--fullscreen .superpops-branding {
  padding-bottom: max(12px, env(safe-area-inset-bottom));
}

/* Mobile: stack — flexible image band on top (~1/3), game below, no page
   scroll. Same 720px breakpoint as the left/right collapse above. */
@media (max-width: 720px) {
  .superpops-popup--fullscreen .superpops-content {
    flex-direction: column;
  }

  .superpops-popup--fullscreen .superpops-layout-image {
    width: 100%;
    flex: 0 1 33dvh;
    min-height: 25dvh;
    height: auto;
    order: unset;
    border-radius: 0;
  }

  .superpops-popup--fullscreen .superpops-main-content {
    flex: 1;
    order: unset;
    padding: 20px 18px 16px;
    overflow-y: auto; /* last-resort fallback — never clip */
    /* overflow-y:auto zeroes the flex min-height, so without this the image
       band never feels pressure to shrink below its 33dvh basis — claim room
       for a typical game first, then let the image give way down to 25dvh */
    min-height: min(420px, 60dvh);
  }
}

/* Match the global reduced-motion fade duration (the double-class rule above
   would otherwise out-rank the single-class rule in the media query at ~L86) */
@media (prefers-reduced-motion: reduce) {
  .superpops-popup.superpops-popup--fullscreen {
    animation: popupFadeIn 0.2s ease-out;
  }
}

/* ============================================================================
   MINI QUIZ GAME (MINI_QUIZ)
   Scoped under .superpops-quiz. Reuses --brand-color and --input-border-color
   design tokens set by the loader / popup container.
   ============================================================================ */
.superpops-quiz {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  padding: 8px 0;
}

.superpops-quiz-progress {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #6b7280;
  text-align: center;
}

.superpops-quiz-progress-track {
  display: block;
  width: 100%;
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: color-mix(in srgb, var(--brand-color, #7b61ff) 14%, #e5e7eb);
}

.superpops-quiz-progress-fill {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: var(--brand-color, #7b61ff);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.28s ease-out;
}

.superpops-quiz-question {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.35;
  color: #1a1a1a;
  text-align: center;
  margin: 0;
  outline: none;
}

.superpops-quiz-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.superpops-quiz-option {
  display: block;
  width: 100%;
  padding: 14px 18px;
  font-size: 15px;
  font-weight: 600;
  text-align: left;
  color: #1a1a1a;
  background: #fff;
  border: 2px solid var(--input-border-color, #e0e0e0);
  border-radius: var(--input-border-radius, 8px);
  cursor: pointer;
  transition:
    border-color 0.2s ease,
    background-color 0.2s ease,
    transform 0.1s ease;
}

.superpops-quiz-option:hover:not(:disabled) {
  border-color: var(--brand-color, #7b61ff);
  background: rgba(123, 97, 255, 0.04);
}

.superpops-quiz-option:active:not(:disabled) {
  transform: scale(0.99);
}

.superpops-quiz-option--selected,
.superpops-quiz-option--selected:hover {
  border-color: var(--brand-color, #7b61ff);
  background: var(--brand-color, #7b61ff);
  color: #fff;
}

.superpops-quiz-option:disabled {
  cursor: default;
}

.superpops-quiz-back {
  align-self: flex-start;
  min-height: 36px;
  padding: 6px 4px;
  border: 0;
  background: transparent;
  color: var(--brand-color, #7b61ff);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

@media (prefers-reduced-motion: reduce) {
  .superpops-canvas,
  .superpops-wheel-area.is-landed .superpops-wheel-pointer,
  .superpops-wheel-area.spinning .superpops-wheel-pointer,
  .superpops-box-inner,
  .superpops-mystery-box.is-opening .superpops-gift-shell,
  .superpops-box-content.revealed {
    animation: none;
  }

  .superpops-box-particle {
    display: none;
  }

  .superpops-scratch-progress-fill,
  .superpops-balloon-result,
  .superpops-quiz-progress-fill {
    transition: none;
  }

  .superpops-quiz-option {
    transition: none;
  }
}
