/* Spot the Differences styles */

:root {
  --card-bg-kitty:  linear-gradient(180deg, #dbeafe 0%, #bfdbfe 55%, #86efac 55%, #4ade80 100%);
  --card-bg-bear:   linear-gradient(180deg, #fef3c7 0%, #fde68a 55%, #86efac 55%, #22c55e 100%);
  --card-bg-rocket: linear-gradient(180deg, #0f172a 0%, #1e1b4b 60%, #312e81 100%);
  --card-bg-frog:   linear-gradient(180deg, #cffafe 0%, #a5f3fc 50%, #06b6d4 50%, #0891b2 100%);
  --card-bg-puppy:  linear-gradient(180deg, #e0f2fe 0%, #bae6fd 55%, #fde68a 55%, #f59e0b 100%);
}

.diff-field {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  max-width: 820px;
  margin: 0 auto;
  padding: 0.5rem 0.75rem 1rem;
  box-sizing: border-box;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* Theme Navigation */
.theme-nav {
  display: flex;
  gap: 0.4rem;
  justify-content: center;
  margin-bottom: 0.55rem;
  width: 100%;
  max-width: 600px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.theme-tab-btn {
  flex: 1;
  min-width: 75px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  padding: 0.45rem 0.5rem;
  font-size: 0.9rem;
  font-weight: 700;
  color: #1e3a8a;
  background: #ffffff;
  border: 2px solid #bfdbfe;
  border-radius: 9999px;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  white-space: nowrap;
}

.theme-tab-btn:hover {
  transform: translateY(-2px);
  background: #eff6ff;
}

.theme-tab-btn.active {
  background: #3b82f6;
  border-color: #1d4ed8;
  color: #ffffff;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3);
}

.theme-tab-btn.is-completed {
  border-color: #86efac;
}

.theme-tab-btn.is-completed .theme-icon {
  filter: drop-shadow(0 0 4px #22c55e);
}

.theme-icon {
  font-size: 1.2rem;
  line-height: 1;
}

/* Status Bar */
.status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 660px;
  margin-bottom: 0.6rem;
  padding: 0 0.5rem;
  box-sizing: border-box;
}

.diff-counter {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}

.star-badge {
  font-size: 1.6rem;
  line-height: 1;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.star-badge.found {
  transform: scale(1.2);
  filter: drop-shadow(0 2px 4px rgba(245, 158, 11, 0.5));
}

.hint-btn {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.85rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: #854d0e;
  background: #fef08a;
  border: 2px solid #facc15;
  border-radius: 9999px;
  cursor: pointer;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
  transition: transform 0.15s ease, background 0.15s ease, opacity 0.2s ease;
}

.hint-btn:hover:not(:disabled) {
  transform: scale(1.05);
  background: #fde047;
}

.hint-btn:active:not(:disabled) {
  transform: scale(0.96);
}

.hint-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

/* Cards Comparison Stage */
.cards-stage {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  width: 100%;
  max-width: 680px;
}

.picture-card {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 1.5rem;
  border: 4px solid #ffffff;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
  box-sizing: border-box;
  overflow: hidden;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
}

.cards-stage.is-solved .picture-card {
  border-color: #f59e0b;
  box-shadow: 0 0 22px rgba(245, 158, 11, 0.45);
  cursor: default;
}

.scene-canvas {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

/* Scene Backgrounds */
.scene-kitty  { background: var(--card-bg-kitty); }
.scene-bear   { background: var(--card-bg-bear); }
.scene-rocket { background: var(--card-bg-rocket); }
.scene-frog   { background: var(--card-bg-frog); }
.scene-puppy  { background: var(--card-bg-puppy); }

/* Scene items & characters */
.scene-item {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  line-height: 1;
  transform: translate(-50%, -50%);
}

.item-cloud {
  font-size: 2.5rem;
}

.item-sun {
  font-size: 3rem;
  filter: drop-shadow(0 0 10px #fde047);
}

.item-character {
  font-size: 4.5rem;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.2));
}

.item-flora {
  font-size: 2.6rem;
}

.item-prop {
  font-size: 2.8rem;
}

/* Interactive Difference Hotspots */
.diff-hotspot {
  position: absolute;
  width: 58px;
  height: 58px;
  margin-left: -29px;
  margin-top: -29px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 20;
  border-radius: 50%;
  touch-action: manipulation;
  background: transparent;
  border: none;
  padding: 0;
  outline: none;
}

.diff-hotspot:focus-visible {
  outline: 3px solid #f59e0b;
  outline-offset: 4px;
}

.diff-hotspot:disabled {
  opacity: 1;
  color: inherit;
  cursor: default;
}

.hotspot-icon {
  font-size: 2.8rem;
  line-height: 1;
  pointer-events: none;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Golden Halo when Found */
.diff-ring {
  position: absolute;
  inset: -6px;
  border: 4px solid #f59e0b;
  border-radius: 50%;
  box-shadow: 0 0 14px #f59e0b;
  pointer-events: none;
  animation: ring-pulse 1.8s ease-in-out infinite alternate;
}

@keyframes ring-pulse {
  0% { transform: scale(0.96); box-shadow: 0 0 8px #f59e0b; }
  100% { transform: scale(1.08); box-shadow: 0 0 18px #f59e0b; }
}

/* Hint Glow Animation */
.diff-hotspot.hint-active .hotspot-icon {
  animation: hint-wobble 0.8s ease-in-out 3;
}

@keyframes hint-wobble {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 0 8px #facc15); }
  50% { transform: scale(1.25) rotate(6deg); filter: drop-shadow(0 0 20px #facc15); }
}

/* Gentle ripple on tap anywhere */
.tap-ripple {
  position: absolute;
  width: 32px;
  height: 32px;
  margin-left: -16px;
  margin-top: -16px;
  border: 2px solid rgba(255, 255, 255, 0.8);
  border-radius: 50%;
  pointer-events: none;
  animation: ripple-out 0.4s ease-out forwards;
}

@keyframes ripple-out {
  0% { transform: scale(0.5); opacity: 1; }
  100% { transform: scale(2.2); opacity: 0; }
}

/* Action Controls Bar */
.action-bar {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  margin: 0.65rem 0;
  min-height: 48px;
  flex-wrap: wrap;
}

.action-pill-btn {
  padding: 0.65rem 1.6rem;
  font-size: 1.15rem;
  font-weight: 800;
  color: #ffffff;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  border: none;
  border-radius: 9999px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  animation: pop-btn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.action-pill-btn:hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.45);
}

.action-pill-btn:active {
  transform: translateY(1px) scale(0.98);
}

.again-btn {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.35);
}

@keyframes pop-btn {
  0% { transform: scale(0.8); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

/* Confetti & Celebration Layer */
.sparks-container {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 50;
}

.sparkle {
  position: absolute;
  font-size: 1.5rem;
  animation: burst 0.85s ease-out forwards;
}

@keyframes burst {
  0% { transform: translate(0, 0) scale(0.5); opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy)) scale(1.35); opacity: 0; }
}

/* Responsive adjustments */
@media (max-width: 540px) {
  .cards-stage {
    grid-template-columns: 1fr;
    max-width: 380px;
    gap: 0.5rem;
  }
  .item-character { font-size: 3.8rem; }
  .item-sun { font-size: 2.4rem; }
  .item-cloud { font-size: 2rem; }
  .hotspot-icon { font-size: 2.3rem; }
  .theme-tab-btn {
    min-width: 65px;
    padding: 0.35rem 0.4rem;
    font-size: 0.8rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .star-badge,
  .action-pill-btn,
  .diff-ring,
  .sparkle,
  .tap-ripple,
  .diff-hotspot.hint-active .hotspot-icon {
    animation: none;
    transition: none;
  }
}
