/* ============================================================
   Crossword Solution Floating Popup
   ============================================================ */

#crossword-popup {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0;
  animation: crossword-slide-in 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

#crossword-popup.crossword-hidden {
  display: none;
}

@keyframes crossword-slide-in {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.92);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Close button */
#crossword-close-btn {
  align-self: flex-end;
  margin-bottom: -1px;
  margin-right: 2px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: #1e293b;
  color: #94a3b8;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
  z-index: 1;
}

#crossword-close-btn:hover {
  background: #e2e8f0;
  color: #1e293b;
  transform: scale(1.15);
}

/* Main card */
#crossword-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-radius: 14px;
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 60%, #0ea5e9 100%);
  box-shadow:
    0 8px 32px rgba(37, 99, 235, 0.40),
    0 2px 8px rgba(0, 0, 0, 0.18);
  cursor: pointer;
  text-decoration: none;
  max-width: 300px;
  position: relative;
  overflow: hidden;
  transition: transform 0.22s ease, box-shadow 0.22s ease;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

/* Subtle shimmer stripe */
#crossword-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    120deg,
    transparent 30%,
    rgba(255, 255, 255, 0.08) 50%,
    transparent 70%
  );
  background-size: 200% 100%;
  animation: crossword-shimmer 3s ease-in-out infinite;
  pointer-events: none;
}

@keyframes crossword-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

#crossword-card:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow:
    0 14px 40px rgba(37, 99, 235, 0.50),
    0 4px 12px rgba(0, 0, 0, 0.20);
}

#crossword-card:active {
  transform: translateY(0) scale(0.99);
}

/* Puzzle emoji icon */
.crossword-icon {
  font-size: 28px;
  flex-shrink: 0;
  line-height: 1;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

/* Text block */
.crossword-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.crossword-title {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.3px;
  text-shadow: 0 1px 3px rgba(0,0,0,0.25);
}

.crossword-subtitle {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 11.5px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.82);
  letter-spacing: 0.1px;
}

/* Arrow pulse */
.crossword-arrow {
  font-size: 16px;
  color: #bfdbfe;
  flex-shrink: 0;
  animation: crossword-arrow-pulse 1.6s ease-in-out infinite;
}

@keyframes crossword-arrow-pulse {
  0%, 100% { transform: translateX(0); opacity: 1; }
  50%       { transform: translateX(4px); opacity: 0.7; }
}

/* ── Responsive ── */
@media (max-width: 480px) {
  #crossword-popup {
    bottom: 16px;
    right: 16px;
  }

  #crossword-card {
    padding: 12px 14px;
    gap: 10px;
    max-width: calc(100vw - 80px);
  }

  .crossword-icon {
    font-size: 22px;
  }

  .crossword-title {
    font-size: 12px;
  }

  .crossword-subtitle {
    font-size: 10.5px;
  }
}
