/* Tap Rush — zone de jeu, cibles produit animées */

body.tap-fullscreen {
  background: linear-gradient(160deg, #fafafa 0%, #eff6ff 40%, #fdf4ff 100%);
  min-height: 100vh;
  height: 100vh;
  overflow: hidden;
  margin: 0;
}

.tap-root {
  min-height: 100vh;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem;
  box-sizing: border-box;
}

.tap-game-page {
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
}

.tap-game-hero {
  background: rgba(255, 255, 255, 0.94);
  border-radius: 1.25rem;
  border: 1px solid #e5e7eb;
  box-shadow: 0 14px 44px rgba(15, 23, 42, 0.08);
  padding: 1rem 0.85rem 1.2rem;
  position: relative;
  overflow: hidden;
}

.tap-game-title {
  font-size: clamp(1.25rem, 4vw, 1.65rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #111827;
  text-align: center;
  margin: 0;
}

.tap-game-subtitle {
  font-size: 0.8rem;
  line-height: 1.45;
  color: #6b7280;
  text-align: center;
  margin: 0.45rem 0 0;
}

.tap-game-subtitle strong {
  color: #4f46e5;
  font-weight: 700;
}

.tap-hud {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  margin-top: 0.75rem;
}

.tap-hud__pill {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.38rem 0.7rem;
  border-radius: 999px;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  color: #374151;
  font-size: 0.72rem;
  font-weight: 600;
}

.tap-hud__pill strong {
  color: #111827;
  font-weight: 800;
}

.tap-hud__pill--score {
  background: #eef2ff;
  border-color: #c7d2fe;
}

.tap-hud__pill--warn {
  animation: tap-pulse 0.85s ease-in-out infinite;
  border-color: rgba(239, 68, 68, 0.45);
  color: #b91c1c;
  background: #fef2f2;
}

@keyframes tap-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.25);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(239, 68, 68, 0);
  }
}

.tap-arena-wrap {
  margin-top: 0.75rem;
  position: relative;
}

.tap-arena {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  max-height: min(58vh, 360px);
  margin: 0 auto;
  border-radius: 1rem;
  background: radial-gradient(circle at 50% 30%, #f8fafc 0%, #e2e8f0 55%, #cbd5e1 100%);
  border: 2px dashed rgba(99, 102, 241, 0.25);
  overflow: hidden;
  touch-action: manipulation;
}

.tap-arena.is-playing {
  border-style: solid;
  border-color: rgba(99, 102, 241, 0.35);
}

.tap-countdown {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(3rem, 18vw, 5rem);
  font-weight: 900;
  color: #4f46e5;
  text-shadow: 0 8px 32px rgba(79, 70, 229, 0.35);
  pointer-events: none;
  z-index: 50;
  animation: tap-count-pop 0.85s cubic-bezier(0.34, 1.45, 0.64, 1) both;
}

@keyframes tap-count-pop {
  from {
    opacity: 0;
    transform: scale(0.5);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.tap-target {
  position: absolute;
  width: clamp(56px, 19vw, 76px);
  height: clamp(56px, 19vw, 76px);
  transform: translate(-50%, -50%);
  border-radius: 1rem;
  overflow: hidden;
  cursor: pointer;
  box-shadow:
    0 10px 28px rgba(15, 23, 42, 0.2),
    0 0 0 3px #fff;
  animation: tap-target-in 0.28s cubic-bezier(0.34, 1.35, 0.64, 1) both;
  z-index: 2;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.tap-target img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

.tap-target--trap {
  box-shadow:
    0 10px 28px rgba(15, 23, 42, 0.2),
    0 0 0 3px #fff,
    0 0 0 5px rgba(234, 179, 8, 0.55);
}

.tap-target--trap-morphed {
  box-shadow:
    0 10px 28px rgba(220, 38, 38, 0.45),
    0 0 0 3px #fecaca,
    0 0 0 5px rgba(220, 38, 38, 0.45);
}

.tap-target--bomb {
  background: linear-gradient(145deg, #7f1d1d 0%, #dc2626 45%, #991b1b 100%);
  box-shadow:
    0 10px 28px rgba(220, 38, 38, 0.45),
    0 0 0 3px #fecaca;
  animation: tap-target-in 0.28s cubic-bezier(0.34, 1.35, 0.64, 1) both,
    tap-bomb-warn 0.55s ease-in-out infinite;
}

@keyframes tap-bomb-warn {
  0%,
  100% {
    filter: brightness(1);
  }
  50% {
    filter: brightness(1.12);
  }
}

.tap-target-bomb-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: clamp(1.75rem, 8vw, 2.35rem);
  line-height: 1;
  user-select: none;
  pointer-events: none;
}

.tap-target-ring--bomb {
  border-color: rgba(254, 202, 202, 0.95);
}

.tap-target.is-hit {
  animation: tap-target-hit 0.38s ease forwards;
  pointer-events: none;
}

@keyframes tap-target-in {
  from {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.35);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

@keyframes tap-target-hit {
  to {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1.25);
  }
}

.tap-target-ring {
  position: absolute;
  inset: -6px;
  border-radius: inherit;
  border: 2px solid rgba(251, 191, 36, 0.9);
  animation: tap-ring 0.9s ease-out forwards;
  pointer-events: none;
}

@keyframes tap-ring {
  to {
    transform: scale(1.35);
    opacity: 0;
  }
}

.tap-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
  margin-top: 0.85rem;
}

.game-cta-btn {
  width: 100%;
  max-width: 280px;
  display: inline-block;
  text-align: center;
  box-sizing: border-box;
}

.game-cta-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.tap-exit-link {
  font-size: 0.8125rem;
  color: #6b7280;
  text-decoration: none;
}

.tap-exit-link:hover {
  color: #4f46e5;
}

.tap-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.tap-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

.tap-modal {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 1.25rem;
  padding: 1.65rem 1.4rem;
  text-align: center;
  box-shadow: 0 28px 80px rgba(15, 23, 42, 0.18);
  transform: translateY(14px) scale(0.96);
  transition: transform 0.42s cubic-bezier(0.34, 1.35, 0.64, 1);
}

.tap-overlay.is-open .tap-modal {
  transform: translateY(0) scale(1);
}

.tap-modal__icon {
  font-size: 2.75rem;
  line-height: 1;
  margin-bottom: 0.35rem;
}

.tap-modal__title {
  font-size: 1.1rem;
  font-weight: 800;
  color: #111827;
  margin: 0 0 0.45rem;
}

.tap-modal__body {
  font-size: 0.88rem;
  line-height: 1.5;
  color: #4b5563;
  margin: 0;
}

.tap-modal__code {
  font-family: ui-monospace, monospace;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 0.6rem 0.9rem;
  margin: 0.75rem 0 0;
  border-radius: 0.75rem;
  background: #eef2ff;
  border: 1px dashed rgba(99, 102, 241, 0.45);
  color: #3730a3;
  word-break: break-all;
}

.tap-modal__code.hidden {
  display: none;
}

.tap-modal__actions {
  margin-top: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.tap-modal__close {
  margin-top: 0.85rem;
  background: none;
  border: none;
  color: #6b7280;
  font-size: 0.875rem;
  cursor: pointer;
  text-decoration: underline;
}

.tap-modal__link-back {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: #4f46e5;
  text-decoration: none;
  margin-top: 0.35rem;
}

.tap-modal__link-back:hover {
  text-decoration: underline;
}

.tap-confetti {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 199;
  overflow: hidden;
}

.tap-confetti span {
  position: absolute;
  width: 8px;
  height: 8px;
  top: -12px;
  left: var(--x);
  background: var(--c);
  border-radius: 2px;
  animation: tap-fall var(--d) linear forwards;
}

@keyframes tap-fall {
  to {
    transform: translateY(110vh) rotate(640deg);
    opacity: 0.5;
  }
}

.hidden {
  display: none !important;
}
