/* ============================================
   Objection Animation Styles
   ============================================ */

/* Flash overlay */
.anim-flash {
  position: fixed;
  inset: 0;
  background: white;
  z-index: 200;
  pointer-events: none;
}

.anim-flash[hidden] {
  display: none;
}

.anim-flash.active {
  animation: objectionFlash 0.25s ease-out forwards;
}

@keyframes objectionFlash {
  0% { opacity: 0; }
  30% { opacity: 1; }
  100% { opacity: 0; }
}

/* Objection text */
.anim-objection-text {
  position: fixed;
  top: 30%;
  left: 0;
  width: 100%;
  text-align: center;
  z-index: 210;
  pointer-events: none;
}

.anim-objection-text[hidden] {
  display: none;
}

.objection-label {
  display: inline-block;
  font-size: 3.5rem;
  font-weight: 900;
  color: #ff3300;
  letter-spacing: 0.2em;
  text-shadow:
    0 0 30px rgba(255, 51, 0, 0.6),
    0 0 60px rgba(255, 51, 0, 0.3),
    3px 3px 0 #8B0000,
    -1px -1px 0 #8B0000,
    1px -1px 0 #8B0000,
    -1px 1px 0 #8B0000;
  -webkit-text-stroke: 1px #8B0000;
  paint-order: stroke fill;
}

.anim-objection-text.slide-in .objection-label {
  animation: objectionSlideIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes objectionSlideIn {
  0% { transform: translateX(-120%) scale(0.5); opacity: 0; }
  60% { transform: translateX(5%) scale(1.1); opacity: 1; }
  80% { transform: translateX(-2%) scale(1.0); }
  100% { transform: translateX(0) scale(1.0); opacity: 1; }
}

.anim-objection-text.fade-out .objection-label {
  animation: objectionFadeOut 0.3s ease forwards;
}

@keyframes objectionFadeOut {
  from { opacity: 1; transform: scale(1); }
  to { opacity: 0; transform: scale(1.2); }
}

/* Player objection character overlay */
.anim-player-objection {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 430px;
  text-align: center;
  z-index: 205;
  pointer-events: none;
}

.anim-player-objection[hidden] {
  display: none;
}

.objection-player-img {
  width: 80%;
  max-width: 350px;
  height: auto;
  filter: drop-shadow(0 -4px 20px rgba(255, 51, 0, 0.4));
}

.anim-player-objection.slide-up {
  animation: playerSlideUp 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes playerSlideUp {
  0% { transform: translateX(-50%) translateY(100%); opacity: 0; }
  70% { transform: translateX(-50%) translateY(-5%); opacity: 1; }
  100% { transform: translateX(-50%) translateY(0); opacity: 1; }
}

.anim-player-objection.slide-down {
  animation: playerSlideDown 0.3s ease forwards;
}

@keyframes playerSlideDown {
  from { transform: translateX(-50%) translateY(0); opacity: 1; }
  to { transform: translateX(-50%) translateY(100%); opacity: 0; }
}

/* Evidence popup */
.anim-evidence-popup {
  position: fixed;
  bottom: 20%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 201;
  pointer-events: none;
}

.anim-evidence-popup[hidden] {
  display: none;
}

.anim-evidence-popup.pop-in {
  animation: evidencePopIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes evidencePopIn {
  0% { transform: translateX(-50%) scale(0) translateY(50px); opacity: 0; }
  100% { transform: translateX(-50%) scale(1) translateY(0); opacity: 1; }
}

.evidence-popup-card {
  background: var(--color-card-bg);
  border: 2px solid var(--color-accent);
  border-radius: var(--border-radius);
  padding: var(--space-md) var(--space-lg);
  text-align: center;
  min-width: 200px;
  box-shadow: 0 8px 32px rgba(255, 215, 0, 0.2);
}

.evidence-popup-icon {
  font-size: 2.5rem;
  margin-bottom: var(--space-xs);
}

.evidence-popup-name {
  font-weight: 700;
  font-size: var(--font-size-lg);
  color: var(--color-accent);
}

/* Rebuttal text overlay */
.anim-rebuttal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  z-index: 202;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: var(--space-xl);
}

.anim-rebuttal-text {
  max-width: 340px;
  font-size: var(--font-size-lg);
  line-height: 1.8;
  color: var(--color-text);
  text-align: center;
}

.anim-reaction-text {
  max-width: 340px;
  font-size: var(--font-size-base);
  color: var(--color-text-dim);
  text-align: center;
  margin-top: var(--space-lg);
  font-style: italic;
}

/* Shatter effect (per-character spans) */
.shatter-char {
  display: inline-block;
  animation: shatterPiece 0.6s ease-out forwards;
  animation-delay: var(--shatter-delay, 0ms);
}

@keyframes shatterPiece {
  0% { 
    transform: translate(0, 0) rotate(0deg); 
    opacity: 1; 
  }
  100% { 
    transform: translate(var(--shatter-x, 20px), var(--shatter-y, 30px)) rotate(var(--shatter-r, 45deg)); 
    opacity: 0; 
  }
}

/* Screen shake (applied to game root) */
.screen-shake {
  animation: screenShake 0.3s ease;
}

@keyframes screenShake {
  0%, 100% { transform: translate(0); }
  20% { transform: translate(-3px, 2px); }
  40% { transform: translate(3px, -2px); }
  60% { transform: translate(-2px, 1px); }
  80% { transform: translate(2px, -1px); }
}
