/* ═══════════════════════════════════════════════════
   COMMI #5 — Bow & Arrow  (events.php only)
   ═══════════════════════════════════════════════════ */

/* ── Desktop only ── */
@media (max-width: 1023px) {
  .ev5-overlay,
  .ev5-score-bar,
  .ev5-canvas {
    display: none !important;
  }
  #ev5Trigger {
    cursor: default !important;
    text-decoration: none !important;
  }
}

/* ══════════════════════════════════════════════════
   TRIGGER WORD  (#ev5Trigger in h1)
   ══════════════════════════════════════════════════ */
#ev5Trigger.ev5-clickable {
  cursor: crosshair;
  position: relative;
  transition: color 0.25s, text-shadow 0.25s;
}

#ev5Trigger.ev5-clickable::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -3px;
  width: 100%;
  height: 2px;
  background: currentColor;
  opacity: 0.35;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

#ev5Trigger.ev5-clickable:hover::after {
  transform: scaleX(1);
  opacity: 0.75;
}

#ev5Trigger.ev5-clickable:hover {
  text-shadow: 0 0 28px rgba(231, 76, 60, 0.7), 0 0 60px rgba(231, 76, 60, 0.3);
  color: #ff6b6b;
}

#ev5Trigger.ev5-collected {
  cursor: default;
  color: #f1c40f !important;
  text-shadow: 0 0 20px rgba(241, 196, 15, 0.7), 0 0 50px rgba(241, 196, 15, 0.3) !important;
}

/* ══════════════════════════════════════════════════
   CANVAS (arrow flight layer)
   ══════════════════════════════════════════════════ */
.ev5-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 8800;
  pointer-events: none;
  display: none;
  cursor: crosshair;
}

.ev5-canvas.ev5-active {
  display: block;
  pointer-events: all;
}

/* ══════════════════════════════════════════════════
   SCORE BAR
   ══════════════════════════════════════════════════ */
.ev5-score-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 8900;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 24px;
  background: rgba(10, 8, 22, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(231, 76, 60, 0.25);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
  pointer-events: none;
  opacity: 0;
  transform: translateY(-100%);
  transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.ev5-score-bar.ev5-open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: all;
}

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

.ev5-score-num {
  font-family: var(--font-family, 'Inter', sans-serif);
  font-size: 1.4rem;
  font-weight: 900;
  color: #fff;
  letter-spacing: -0.02em;
  line-height: 1;
  transition: transform 0.1s ease;
  display: inline-block;
}

.ev5-score-num.ev5-bump {
  transform: scale(1.35);
  color: #e74c3c;
}

.ev5-score-total {
  color: rgba(255, 255, 255, 0.45);
}

.ev5-score-sep {
  font-family: var(--font-family, 'Inter', sans-serif);
  font-size: 1.1rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.25);
}

.ev5-score-label {
  font-family: var(--font-family, 'Inter', sans-serif);
  font-size: 0.72rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.38);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-right: 8px;
}

.ev5-progress-bar {
  flex: 1;
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 100px;
  overflow: hidden;
}

.ev5-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #e74c3c, #f39c12);
  border-radius: 100px;
  transition: width 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 0 8px rgba(231, 76, 60, 0.6);
}

.ev5-quit-btn {
  margin-left: auto;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 100px;
  padding: 5px 14px;
  color: rgba(255, 255, 255, 0.38);
  font-family: var(--font-family, 'Inter', sans-serif);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: 0.04em;
  transition: all 0.2s;
  pointer-events: all;
}

.ev5-quit-btn:hover {
  color: rgba(255, 255, 255, 0.7);
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.07);
}

/* ══════════════════════════════════════════════════
   OVERLAY BASE  (Intro + Win share this)
   ══════════════════════════════════════════════════ */
.ev5-overlay {
  position: fixed;
  inset: 0;
  z-index: 9200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.ev5-overlay.ev5-open {
  opacity: 1;
  pointer-events: all;
}

/* ── Shared badge ── */
.ev5-badge {
  display: inline-block;
  background: linear-gradient(135deg, #922b21, #e74c3c);
  color: white;
  font-size: 0.65rem;
  font-weight: 900;
  letter-spacing: 0.3em;
  padding: 4px 16px;
  border-radius: 100px;
  margin-bottom: 20px;
  text-transform: uppercase;
  box-shadow: 0 0 20px rgba(231, 76, 60, 0.5), 0 0 45px rgba(231, 76, 60, 0.18);
  animation: ev5BadgePulse 2.2s ease-in-out infinite;
}

@keyframes ev5BadgePulse {
  0%, 100% { box-shadow: 0 0 20px rgba(231, 76, 60, 0.5), 0 0 45px rgba(231, 76, 60, 0.18); }
  50%       { box-shadow: 0 0 32px rgba(231, 76, 60, 0.85), 0 0 70px rgba(231, 76, 60, 0.3); }
}

/* ══════════════════════════════════════════════════
   INTRO CARD
   ══════════════════════════════════════════════════ */
.ev5-intro-card {
  position: relative;
  background: linear-gradient(145deg, #12101f 0%, #1c1030 55%, #0f0d1e 100%);
  border: 1px solid rgba(231, 76, 60, 0.2);
  border-radius: 28px;
  padding: 48px 44px 42px;
  max-width: 480px;
  width: 92%;
  text-align: center;
  box-shadow:
    0 40px 100px rgba(0, 0, 0, 0.8),
    0 0 70px rgba(200, 50, 30, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transform: translateY(40px) scale(0.94);
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.ev5-overlay.ev5-open .ev5-intro-card {
  transform: translateY(0) scale(1);
}

.ev5-close-btn {
  position: absolute;
  top: 16px;
  right: 20px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  color: rgba(255, 255, 255, 0.38);
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.ev5-close-btn:hover {
  color: white;
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.25);
}

.ev5-icon {
  font-size: 3.8rem;
  margin-bottom: 18px;
  display: block;
  animation: ev5IconFloat 2.4s ease-in-out infinite;
}

@keyframes ev5IconFloat {
  0%, 100% { transform: translateY(0) rotate(-5deg); }
  50%       { transform: translateY(-10px) rotate(5deg); }
}

.ev5-intro-card h2 {
  font-family: var(--font-family, 'Inter', sans-serif);
  font-size: 2rem;
  font-weight: 900;
  color: #fff;
  letter-spacing: -0.025em;
  margin-bottom: 12px;
  text-shadow: 0 0 30px rgba(231, 76, 60, 0.4);
}

.ev5-intro-card > p {
  font-family: var(--font-family, 'Inter', sans-serif);
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.65);
  line-height: 1.65;
  margin-bottom: 22px;
}

.ev5-intro-card > p strong {
  color: #e74c3c;
}

.ev5-instructions {
  list-style: none;
  padding: 0;
  margin: 0 0 28px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 14px;
  padding: 16px 20px;
}

.ev5-instructions li {
  font-family: var(--font-family, 'Inter', sans-serif);
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.5);
  padding-left: 20px;
  position: relative;
  letter-spacing: 0.01em;
}

.ev5-instructions li::before {
  content: '›';
  position: absolute;
  left: 0;
  color: #e74c3c;
  font-weight: 700;
}

.ev5-start-btn {
  width: 100%;
  padding: 16px 0;
  background: linear-gradient(135deg, #8b1a10 0%, #c0392b 50%, #8b1a10 100%);
  background-size: 220% 100%;
  background-position: 0% 0%;
  border: 1.5px solid rgba(231, 76, 60, 0.5);
  border-radius: 14px;
  color: #fff;
  font-family: var(--font-family, 'Inter', sans-serif);
  font-size: 1rem;
  font-weight: 900;
  letter-spacing: 0.2em;
  cursor: pointer;
  text-transform: uppercase;
  transition: all 0.3s ease;
  box-shadow: 0 0 28px rgba(192, 57, 43, 0.2), 0 4px 20px rgba(0, 0, 0, 0.4);
  animation: ev5StartGlow 2.6s ease-in-out infinite;
}

@keyframes ev5StartGlow {
  0%, 100% { box-shadow: 0 0 28px rgba(192,57,43,0.2), 0 4px 20px rgba(0,0,0,0.4); }
  50%       { box-shadow: 0 0 50px rgba(192,57,43,0.5), 0 4px 20px rgba(0,0,0,0.4); }
}

.ev5-start-btn:hover {
  background-position: 100% 0%;
  border-color: rgba(231, 76, 60, 0.85);
  transform: translateY(-2px) scale(1.01);
  box-shadow: 0 0 55px rgba(192, 57, 43, 0.55), 0 8px 30px rgba(0, 0, 0, 0.5);
  animation: none;
}

.ev5-start-btn:active {
  transform: translateY(0) scale(0.99);
}

/* ══════════════════════════════════════════════════
   WIN CARD
   ══════════════════════════════════════════════════ */
.ev5-win-card {
  position: relative;
  background: linear-gradient(145deg, #12101f 0%, #1c1a10 55%, #0f0d1e 100%);
  border: 1px solid rgba(241, 196, 15, 0.3);
  border-radius: 28px;
  padding: 60px 50px 52px;
  max-width: 420px;
  width: 90%;
  text-align: center;
  overflow: hidden;
  box-shadow:
    0 40px 100px rgba(0, 0, 0, 0.85),
    0 0 80px rgba(241, 196, 15, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transform: scale(0.88);
  transition: transform 0.52s cubic-bezier(0.16, 1, 0.3, 1);
}

.ev5-overlay.ev5-open .ev5-win-card {
  transform: scale(1);
}

.ev5-win-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.ev5-win-particle {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  animation: ev5WinPartFloat linear infinite;
}

@keyframes ev5WinPartFloat {
  0%   { transform: translateY(110%) scale(0);   opacity: 0; }
  8%   { opacity: 0.8; }
  92%  { opacity: 0.4; }
  100% { transform: translateY(-20%) scale(1.2); opacity: 0; }
}

.ev5-win-emoji {
  font-size: 4rem;
  margin-bottom: 16px;
  display: block;
  animation: ev5EmojiDrop 0.65s cubic-bezier(0.16, 1, 0.3, 1) 0.25s both;
}

@keyframes ev5EmojiDrop {
  from { transform: scale(0) rotate(-20deg); opacity: 0; }
  to   { transform: scale(1) rotate(0);      opacity: 1; }
}

.ev5-win-card h2 {
  font-family: var(--font-family, 'Inter', sans-serif);
  font-size: 2.2rem;
  font-weight: 900;
  color: white;
  letter-spacing: -0.025em;
  margin-bottom: 12px;
  text-shadow: 0 0 30px rgba(241, 196, 15, 0.5);
}

.ev5-win-card > p {
  font-family: var(--font-family, 'Inter', sans-serif);
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.5);
  line-height: 1.65;
  margin-bottom: 32px;
}

.ev5-claim-btn {
  width: 100%;
  padding: 15px 0;
  background: linear-gradient(135deg, #7d6608, #d4ac0d);
  border: 1.5px solid rgba(241, 196, 15, 0.55);
  border-radius: 13px;
  color: #fff;
  font-family: var(--font-family, 'Inter', sans-serif);
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: all 0.28s ease;
  box-shadow: 0 0 30px rgba(212, 172, 13, 0.25);
}

.ev5-claim-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 55px rgba(212, 172, 13, 0.55), 0 6px 24px rgba(0,0,0,0.4);
}

/* ══════════════════════════════════════════════════
   ACTIVE TARGETS  (ev5-target spans injected by JS)
   ══════════════════════════════════════════════════ */
.ev5-target {
  display: inline;
  position: relative;
}

.ev5-target.ev5-target-active {
  /* intentionally invisible — player must search for event words */
}

.ev5-target[data-hit="1"] {
  animation: none;
  outline: none;
  background: none;
}

/* ══════════════════════════════════════════════════
   HIT FLASH  (added briefly to hit target)
   ══════════════════════════════════════════════════ */
.ev5-hit-flash {
  animation: ev5HitFlash 0.18s ease-out forwards !important;
}

@keyframes ev5HitFlash {
  0%   { background: rgba(255, 200, 50, 0.8); outline-color: #f1c40f; box-shadow: 0 0 20px #f1c40f; }
  100% { background: transparent; outline: none; box-shadow: none; }
}
