/* Bloodjack - Custom CSS */

/* ===== Base ===== */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'EB Garamond', serif;
  background:
    radial-gradient(ellipse at 20% 80%, rgba(70, 10, 10, 0.4) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(50, 5, 5, 0.3) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, #0d0505 0%, #0a0a0a 60%, #050000 100%);
  color: #e5e5e5;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3 {
  font-family: 'Cinzel Decorative', cursive;
}

h2 {
  font-size: 2rem;
  text-align: center;
  margin-bottom: 1.25rem;
  color: #b91c1c;
  letter-spacing: 0.03em;
  line-height: 1.3;
}

/* ===== Screen Reader Only ===== */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 1.5rem;
  font-family: 'Cinzel Decorative', cursive;
  font-size: 1.125rem;
  font-weight: 700;
  border-radius: 0.625rem;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  user-select: none;
}

.btn:focus-visible {
  outline: 2px solid #dc2626;
  outline-offset: 2px;
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-primary {
  background: linear-gradient(135deg, #b91c1c, #7f1d1d);
  color: #fff;
  border-color: #dc2626;
  box-shadow: 0 2px 8px rgba(185, 28, 28, 0.3);
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #dc2626, #991b1b);
  box-shadow: 0 4px 16px rgba(220, 38, 38, 0.5);
  transform: translateY(-1px);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0) scale(0.98);
}

.btn-secondary {
  background: linear-gradient(135deg, #374151, #1f2937);
  color: #d1d5db;
  border-color: #4b5563;
}

.btn-secondary:hover:not(:disabled) {
  background: linear-gradient(135deg, #4b5563, #374151);
  color: #f3f4f6;
  border-color: #6b7280;
}

.btn-glow {
  animation: btn-glow-pulse 2s ease-in-out infinite;
}

@keyframes btn-glow-pulse {
  0%, 100% {
    box-shadow: 0 0 8px rgba(220, 38, 38, 0.4), 0 0 16px rgba(220, 38, 38, 0.2);
  }
  50% {
    box-shadow: 0 0 16px rgba(220, 38, 38, 0.7), 0 0 32px rgba(220, 38, 38, 0.4);
  }
}

.btn-turbo-glow {
  background: linear-gradient(135deg, #7c2d12, #431407) !important;
  border-color: #ea580c !important;
  animation: btn-turbo-pulse 1s ease-in-out infinite;
}

@keyframes btn-turbo-pulse {
  0%, 100% {
    box-shadow: 0 0 8px rgba(234, 88, 12, 0.5), 0 0 16px rgba(234, 88, 12, 0.3);
  }
  50% {
    box-shadow: 0 0 20px rgba(234, 88, 12, 0.8), 0 0 40px rgba(234, 88, 12, 0.5);
  }
}

/* ===== Cards ===== */
.card {
  width: 5rem;
  height: 7rem;
  position: relative;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4), 0 1px 2px rgba(0, 0, 0, 0.3);
}

@media (min-width: 768px) {
  .card {
    width: 6rem;
    height: 8.5rem;
  }
}

.card-rank {
  font-family: 'Cinzel Decorative', cursive;
  line-height: 1;
}

.card-suit {
  line-height: 1;
}

.card-flipper {
  perspective: 1000px;
  transform-style: preserve-3d;
  transition: transform 0.6s ease-in-out;
}

.card-flipper.is-flipped {
  transform: translateX(-50%) rotateY(180deg);
}

.card-front {
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform: rotateY(0deg);
}

.card-back {
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform: rotateY(180deg);
  background: linear-gradient(135deg, #7f1d1d, #450a0a);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #dc2626;
}

.final-card-clickable {
  cursor: pointer;
  transition: transform 0.2s ease;
}

.final-card-clickable:hover {
  transform: translateX(-50%) scale(1.05);
}

/* ===== Card Event Flash ===== */
.animate-event-correct {
  animation: event-flash-correct 1.2s ease-out;
}

@keyframes event-flash-correct {
  0% { box-shadow: inset 0 0 0px rgba(34, 197, 94, 0); }
  30% { box-shadow: inset 0 0 80px rgba(34, 197, 94, 0.3), 0 0 20px rgba(34, 197, 94, 0.4); }
  100% { box-shadow: inset 0 0 0px rgba(34, 197, 94, 0); }
}

.animate-event-incorrect {
  animation: event-flash-incorrect 1.2s ease-out;
}

@keyframes event-flash-incorrect {
  0% { box-shadow: inset 0 0 0px rgba(239, 68, 68, 0); }
  30% { box-shadow: inset 0 0 80px rgba(239, 68, 68, 0.35), 0 0 20px rgba(239, 68, 68, 0.4); }
  100% { box-shadow: inset 0 0 0px rgba(239, 68, 68, 0); }
}

.animate-event-ace {
  animation: event-flash-ace 1.2s ease-out;
}

@keyframes event-flash-ace {
  0% { box-shadow: inset 0 0 0px rgba(59, 130, 246, 0); }
  30% { box-shadow: inset 0 0 80px rgba(59, 130, 246, 0.3), 0 0 20px rgba(59, 130, 246, 0.4); }
  100% { box-shadow: inset 0 0 0px rgba(59, 130, 246, 0); }
}

.animate-event-jack {
  animation: event-flash-jack 1.2s ease-out;
}

@keyframes event-flash-jack {
  0% { box-shadow: inset 0 0 0px rgba(127, 29, 29, 0); }
  30% { box-shadow: inset 0 0 90px rgba(127, 29, 29, 0.5), 0 0 25px rgba(185, 28, 28, 0.5); }
  100% { box-shadow: inset 0 0 0px rgba(127, 29, 29, 0); }
}

.animate-event-queen {
  animation: event-flash-queen 1.2s ease-out;
}

@keyframes event-flash-queen {
  0% { box-shadow: inset 0 0 0px rgba(250, 204, 21, 0); }
  30% { box-shadow: inset 0 0 80px rgba(250, 204, 21, 0.25), 0 0 20px rgba(250, 204, 21, 0.4); }
  100% { box-shadow: inset 0 0 0px rgba(250, 204, 21, 0); }
}

.animate-event-king {
  animation: event-flash-king 1.2s ease-out;
}

@keyframes event-flash-king {
  0% { box-shadow: inset 0 0 0px rgba(168, 85, 247, 0); }
  30% { box-shadow: inset 0 0 80px rgba(168, 85, 247, 0.3), 0 0 20px rgba(168, 85, 247, 0.4); }
  100% { box-shadow: inset 0 0 0px rgba(168, 85, 247, 0); }
}

.animate-event-kq-bonus {
  animation: event-flash-kq-bonus 1.2s ease-out;
}

@keyframes event-flash-kq-bonus {
  0% { box-shadow: inset 0 0 0px rgba(250, 204, 21, 0); }
  25% { box-shadow: inset 0 0 70px rgba(250, 204, 21, 0.25), 0 0 15px rgba(168, 85, 247, 0.3); }
  50% { box-shadow: inset 0 0 80px rgba(168, 85, 247, 0.3), 0 0 20px rgba(250, 204, 21, 0.4); }
  100% { box-shadow: inset 0 0 0px rgba(250, 204, 21, 0); }
}

.animate-event-trickster {
  animation: event-flash-trickster 1.2s ease-out;
}

@keyframes event-flash-trickster {
  0% { box-shadow: inset 0 0 0px rgba(249, 115, 22, 0); }
  30% { box-shadow: inset 0 0 80px rgba(249, 115, 22, 0.3), 0 0 20px rgba(249, 115, 22, 0.4); }
  100% { box-shadow: inset 0 0 0px rgba(249, 115, 22, 0); }
}

.animate-event-bloodsurge {
  animation: event-flash-bloodsurge 1.5s ease-out;
}

@keyframes event-flash-bloodsurge {
  0% { box-shadow: inset 0 0 0px rgba(185, 28, 28, 0); }
  20% { box-shadow: inset 0 0 60px rgba(185, 28, 28, 0.2); }
  40% { box-shadow: inset 0 0 100px rgba(220, 38, 38, 0.4), 0 0 25px rgba(185, 28, 28, 0.5); }
  60% { box-shadow: inset 0 0 80px rgba(185, 28, 28, 0.3); }
  100% { box-shadow: inset 0 0 0px rgba(185, 28, 28, 0); }
}

/* ===== Card Event Badge ===== */
.card-event-badge {
  position: absolute;
  top: -0.5rem;
  left: 50%;
  transform: translateX(-50%);
  padding: 0.2rem 0.6rem;
  border-radius: 0.375rem;
  font-family: 'Cinzel Decorative', cursive;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  white-space: nowrap;
  z-index: 10;
  pointer-events: none;
  animation: badge-fade 2.5s ease-out forwards;
}

@keyframes badge-fade {
  0% { opacity: 0; transform: translateX(-50%) translateY(8px); }
  15% { opacity: 1; transform: translateX(-50%) translateY(0); }
  70% { opacity: 1; transform: translateX(-50%) translateY(0); }
  100% { opacity: 0; transform: translateX(-50%) translateY(-4px); }
}

.card-event-badge-correct {
  background: linear-gradient(135deg, #15803d, #166534);
  border: 1px solid #22c55e;
  color: #86efac;
}

.card-event-badge-incorrect {
  background: linear-gradient(135deg, #991b1b, #7f1d1d);
  border: 1px solid #ef4444;
  color: #fca5a5;
}

.card-event-badge-ace {
  background: linear-gradient(135deg, #1e40af, #1e3a8a);
  border: 1px solid #3b82f6;
  color: #93c5fd;
}

.card-event-badge-jack {
  background: linear-gradient(135deg, #450a0a, #7f1d1d);
  border: 1px solid #b91c1c;
  color: #fca5a5;
}

.card-event-badge-queen {
  background: linear-gradient(135deg, #a16207, #854d0e);
  border: 1px solid #facc15;
  color: #fde047;
}

.card-event-badge-king {
  background: linear-gradient(135deg, #6b21a8, #581c87);
  border: 1px solid #a855f7;
  color: #d8b4fe;
}

.card-event-badge-kq-bonus {
  background: linear-gradient(135deg, #854d0e, #6b21a8);
  border: 1px solid #facc15;
  color: #fde047;
}

.card-event-badge-trickster {
  background: linear-gradient(135deg, #9a3412, #7c2d12);
  border: 1px solid #f97316;
  color: #fdba74;
}

.card-event-badge-bloodsurge {
  background: linear-gradient(135deg, #7f1d1d, #450a0a);
  border: 1px solid #dc2626;
  color: #fca5a5;
}

/* ===== Pile ===== */
.pile-frame {
  border-radius: 0.875rem;
  border: 2px solid rgba(127, 29, 29, 0.5);
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.3);
}

.pile-frame.is-locked {
  filter: grayscale(0.3);
}

.pile-button {
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid;
  cursor: pointer;
  transition: all 0.2s ease;
  background: rgba(0, 0, 0, 0.4);
}

@media (min-width: 768px) {
  .pile-button {
    width: 3.5rem;
    height: 3.5rem;
  }
}

.pile-button:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.pile-button-higher {
  border-color: #22c55e;
  color: #22c55e;
}

.pile-button-higher:hover:not(:disabled) {
  background: rgba(34, 197, 94, 0.2);
  box-shadow: 0 0 12px rgba(34, 197, 94, 0.4);
}

.pile-button-lower {
  border-color: #ef4444;
  color: #ef4444;
}

.pile-button-lower:hover:not(:disabled) {
  background: rgba(239, 68, 68, 0.2);
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.4);
}

/* ===== Panel Inset ===== */
.panel-inset {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(127, 29, 29, 0.3);
  border-radius: 0.875rem;
  padding: 1.125rem;
  backdrop-filter: blur(6px);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
}

/* ===== Modal ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse at center, rgba(20, 5, 5, 0.85) 0%, rgba(0, 0, 0, 0.92) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 1rem;
  backdrop-filter: blur(6px);
}

.modal-content {
  background: linear-gradient(135deg, #1a1a1a, #0f0f0f);
  border: 2px solid #b91c1c;
  border-radius: 1.125rem;
  padding: 2.25rem;
  max-width: 42rem;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 0 50px rgba(185, 28, 28, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.06), inset 0 0 30px rgba(0, 0, 0, 0.3);
  animation: modal-enter 0.35s ease-out;
}

@keyframes modal-enter {
  from { opacity: 0; transform: scale(0.92) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

/* ===== Modal Headings ===== */
.modal-heading {
  font-family: 'Cinzel Decorative', cursive;
  font-size: 2rem;
  text-align: center;
  margin-bottom: 1.25rem;
  color: #b91c1c;
  letter-spacing: 0.03em;
  line-height: 1.3;
  position: relative;
  padding-bottom: 0.75rem;
}

.modal-heading::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 1px;
  background: linear-gradient(90deg, transparent, #b91c1c, transparent);
}

.modal-subtitle {
  font-style: italic;
  color: #9ca3af;
  letter-spacing: 0.02em;
  text-align: center;
  margin-bottom: 1.5rem;
}

.modal-prompt-text {
  font-size: 1.125rem;
  line-height: 1.7;
  color: #d1d5db;
  text-align: center;
  margin-bottom: 1.5rem;
}

/* ===== Lore Modal ===== */
.lore-entry {
  padding: 0.875rem 1.125rem;
  border-left: 3px solid #b91c1c;
  border-radius: 0 0.5rem 0.5rem 0;
  background: rgba(185, 28, 28, 0.06);
  margin-bottom: 0.75rem;
  transition: background 0.2s ease;
  font-size: 1.0625rem;
  line-height: 1.7;
  color: #d1d5db;
}

.lore-entry:hover {
  background: rgba(185, 28, 28, 0.12);
}

.lore-badge {
  display: inline-block;
  padding: 0.15rem 0.6rem;
  background: linear-gradient(135deg, #7f1d1d, #450a0a);
  border: 1px solid #b91c1c;
  border-radius: 0.375rem;
  font-family: 'Cinzel Decorative', cursive;
  font-size: 0.95rem;
  color: #fca5a5;
  margin-right: 0.5rem;
  letter-spacing: 0.02em;
}

/* ===== Rules Modal ===== */
.rules-section {
  padding: 1rem 1.25rem;
  border-left: 3px solid #b91c1c;
  border-radius: 0 0.5rem 0.5rem 0;
  background: rgba(185, 28, 28, 0.05);
  margin-bottom: 1rem;
  transition: background 0.2s ease;
}

.rules-section:hover {
  background: rgba(185, 28, 28, 0.1);
}

.rules-badge {
  display: inline-block;
  padding: 0.2rem 0.75rem;
  background: linear-gradient(135deg, #b91c1c, #7f1d1d);
  border-radius: 0.375rem;
  font-family: 'Cinzel Decorative', cursive;
  font-size: 1rem;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.rules-section p {
  line-height: 1.7;
  letter-spacing: 0.01em;
  color: #d1d5db;
  font-size: 1.0625rem;
}

/* ===== Victory Screen ===== */
.victory-title {
  animation: victory-glow 2.5s ease-in-out infinite;
}

@keyframes victory-glow {
  0%, 100% { text-shadow: 0 0 15px rgba(250, 204, 21, 0.7), 0 0 30px rgba(250, 204, 21, 0.3); }
  50% { text-shadow: 0 0 25px rgba(250, 204, 21, 0.9), 0 0 50px rgba(250, 204, 21, 0.5); }
}

.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0.6rem 1rem;
  border-bottom: 1px solid rgba(250, 204, 21, 0.15);
  border-radius: 0.375rem;
  transition: background 0.2s ease;
}

.stat-row:hover {
  background: rgba(250, 204, 21, 0.06);
}

.guess-timeline {
  display: flex;
  height: 2.75rem;
  width: 100%;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 0.5rem;
  border: 1px solid rgba(75, 85, 99, 0.5);
  padding: 0.375rem;
  gap: 0.25rem;
  overflow: hidden;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.4);
}

.guess-timeline-bar {
  flex-grow: 1;
  border-radius: 0.25rem;
  min-width: 4px;
  transition: transform 0.15s ease;
}

.guess-timeline-bar:hover {
  transform: scaleY(1.1);
}

.guess-timeline-bar-correct {
  background: linear-gradient(180deg, #22c55e, #15803d);
  box-shadow: 0 0 4px rgba(34, 197, 94, 0.4);
}

.guess-timeline-bar-incorrect {
  background: linear-gradient(180deg, #ef4444, #991b1b);
  box-shadow: 0 0 4px rgba(239, 68, 68, 0.4);
}

/* ===== Defeat Screen ===== */
.defeat-overlay {
  background: radial-gradient(ellipse at center, rgba(40, 5, 5, 0.9) 0%, rgba(0, 0, 0, 0.95) 100%) !important;
  backdrop-filter: blur(6px);
}

.defeat-title {
  animation: defeat-pulse 3s ease-in-out infinite;
}

@keyframes defeat-pulse {
  0%, 100% { text-shadow: 0 0 15px rgba(185, 28, 28, 0.6), 0 0 30px rgba(185, 28, 28, 0.3); }
  50% { text-shadow: 0 0 25px rgba(220, 38, 38, 0.8), 0 0 50px rgba(185, 28, 28, 0.4); }
}

.defeat-card-reveal {
  animation: defeat-reveal-pulse 2s ease-in-out infinite;
}

@keyframes defeat-reveal-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* ===== Modal Form Elements ===== */
.modal-form-select {
  background: rgba(20, 20, 20, 0.9);
  border: 1px solid rgba(127, 29, 29, 0.5);
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  color: #e5e5e5;
  font-family: 'EB Garamond', serif;
  font-size: 1rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23b91c1c' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2.5rem;
}

.modal-form-select:focus {
  outline: none;
  border-color: #dc2626;
  box-shadow: 0 0 12px rgba(220, 38, 38, 0.25);
}

.modal-form-select option {
  background: #1a1a1a;
  color: #e5e5e5;
}

/* ===== Start Screen ===== */
.start-screen-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem;
  text-align: center;
}

.start-screen-lore {
  max-width: 36rem;
  font-size: 1.125rem;
  line-height: 2;
  color: #9ca3af;
  font-style: italic;
  margin-bottom: 2.5rem;
  font-family: 'EB Garamond', serif;
  padding: 0 1.5rem;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
  position: relative;
}

.start-screen-lore::before {
  content: '"';
  position: absolute;
  top: -1.5rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 3rem;
  color: rgba(185, 28, 28, 0.3);
  font-family: 'Cinzel Decorative', cursive;
  line-height: 1;
}

.start-screen-lore::after {
  content: '"';
  position: absolute;
  bottom: -2rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 3rem;
  color: rgba(185, 28, 28, 0.3);
  font-family: 'Cinzel Decorative', cursive;
  line-height: 1;
}

.start-screen-lore:first-letter {
  font-size: 1.6em;
  font-family: 'Cinzel Decorative', cursive;
  color: #b91c1c;
  font-style: normal;
  line-height: 1;
  margin-right: 0.05em;
}

/* ===== Header Logo ===== */
.header-logo {
  height: 2.5rem;
  width: auto;
}

@media (min-width: 768px) {
  .header-logo {
    height: 3rem;
  }
}

/* ===== Seed Input ===== */
.seed-input {
  background: rgba(0, 0, 0, 0.5);
  border: 2px solid rgba(127, 29, 29, 0.5);
  border-radius: 0.5rem;
  padding: 0.6rem 1rem;
  color: #e5e5e5;
  font-family: 'EB Garamond', serif;
  font-size: 1rem;
  text-align: center;
  transition: border-color 0.2s ease;
  max-width: 20rem;
}

.seed-input:focus {
  outline: none;
  border-color: #dc2626;
  box-shadow: 0 0 12px rgba(220, 38, 38, 0.25), 0 0 4px rgba(220, 38, 38, 0.15);
}

.seed-input::placeholder {
  color: #6b7280;
}

/* ===== Deck Count & Progress Bar ===== */
.deck-count-text {
  font-family: 'Cinzel Decorative', cursive;
  font-size: 2.5rem;
  font-weight: 700;
  color: #dc2626;
  text-shadow: 0 0 12px rgba(220, 38, 38, 0.3), 0 0 4px rgba(220, 38, 38, 0.2);
  min-width: 3rem;
  text-align: center;
}

@media (min-width: 768px) {
  .deck-count-text {
    font-size: 3rem;
  }
}

.progress-bar-container-inset {
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(127, 29, 29, 0.3);
  border-radius: 9999px;
  height: 1.5rem;
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.4);
}

.progress-bar-fill-pulsing {
  height: 100%;
  background: linear-gradient(90deg, #b91c1c, #dc2626, #ef4444);
  border-radius: 9999px;
  transition: width 0.5s ease;
  animation: progress-pulse 2s ease-in-out infinite;
}

@keyframes progress-pulse {
  0%, 100% {
    opacity: 0.8;
  }
  50% {
    opacity: 1;
  }
}

/* ===== Tips ===== */
.tips-content {
  overflow: hidden;
  transition: max-height 0.4s ease, padding 0.4s ease, opacity 0.3s ease;
  max-height: 500px;
  padding: 1rem;
  opacity: 1;
}

.tips-content-collapsed {
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  opacity: 0;
}

/* ===== Free Placement Glow ===== */
.free-placement-glow {
  animation: free-placement-glow-pulse 1.5s ease-in-out infinite;
}

@keyframes free-placement-glow-pulse {
  0%, 100% {
    box-shadow: inset 0 0 40px rgba(250, 204, 21, 0.1);
  }
  50% {
    box-shadow: inset 0 0 60px rgba(250, 204, 21, 0.2);
  }
}

/* ===== Animated Background ===== */
.animated-background {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

/* Vignette overlay */
.animated-background::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 30%, rgba(0, 0, 0, 0.5) 80%, rgba(0, 0, 0, 0.85) 100%);
  pointer-events: none;
  z-index: 10;
}

/* Film grain noise overlay */
.animated-background::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.4'/%3E%3C/svg%3E");
  opacity: 0.04;
  pointer-events: none;
  z-index: 11;
  animation: grain-flicker 0.3s steps(4) infinite;
}

@keyframes grain-flicker {
  0% { transform: translate(0, 0); }
  25% { transform: translate(-2px, 1px); }
  50% { transform: translate(1px, -2px); }
  75% { transform: translate(-1px, 2px); }
  100% { transform: translate(2px, -1px); }
}

/* Fog / mist layers */
.fog-layer {
  position: absolute;
  width: 150vw;
  height: 150vh;
  top: -25vh;
  left: -25vw;
  border-radius: 50%;
  pointer-events: none;
  z-index: 1;
}

.fog-layer-1 {
  background: radial-gradient(ellipse at 40% 40%, rgba(80, 10, 10, 0.08) 0%, transparent 60%);
  filter: blur(40px);
  animation: fog-drift-1 50s ease-in-out infinite alternate;
}

.fog-layer-2 {
  background: radial-gradient(ellipse at 60% 60%, rgba(40, 5, 5, 0.1) 0%, transparent 55%);
  filter: blur(60px);
  animation: fog-drift-2 65s ease-in-out infinite alternate;
}

@keyframes fog-drift-1 {
  0% { transform: translate(0, 0) rotate(0deg); }
  50% { transform: translate(8vw, 5vh) rotate(15deg); }
  100% { transform: translate(-5vw, -8vh) rotate(-10deg); }
}

@keyframes fog-drift-2 {
  0% { transform: translate(0, 0) rotate(0deg); }
  50% { transform: translate(-10vw, 6vh) rotate(-20deg); }
  100% { transform: translate(6vw, -4vh) rotate(12deg); }
}

.cell {
  position: absolute;
  border-radius: 50%;
  transition: opacity 1.2s ease, transform 1.2s ease, background 1.2s ease, box-shadow 1.2s ease, filter 1.2s ease;
}

.blood-cell {
  width: 80px;
  height: 80px;
}

.blood-cell-small {
  width: 50px;
  height: 50px;
}

.blood-cell-large {
  width: 130px;
  height: 130px;
}

/* Aggressive cell with breathing aura */
.aggressive-cell {
  width: 200px;
  height: 200px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  transition: opacity 1.2s ease, transform 1.2s ease, background 1.2s ease, box-shadow 1.2s ease;
  animation: aggressive-breathe 5s ease-in-out infinite;
  z-index: 5;
}

.aggressive-cell-wrapper {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 300px;
  height: 300px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 4;
}

.aggressive-cell-wrapper::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    rgba(185, 28, 28, 0) 0%,
    rgba(185, 28, 28, 0.15) 25%,
    rgba(220, 38, 38, 0.25) 50%,
    rgba(185, 28, 28, 0.15) 75%,
    rgba(185, 28, 28, 0) 100%
  );
  filter: blur(20px);
  animation: aggressive-aura 12s linear infinite;
}

.aggressive-cell-wrapper::after {
  content: '';
  position: absolute;
  inset: 30px;
  border-radius: 50%;
  background: conic-gradient(
    from 180deg,
    rgba(255, 80, 80, 0) 0%,
    rgba(255, 80, 80, 0.1) 30%,
    rgba(255, 50, 50, 0.2) 50%,
    rgba(255, 80, 80, 0.1) 70%,
    rgba(255, 80, 80, 0) 100%
  );
  filter: blur(15px);
  animation: aggressive-aura 8s linear infinite reverse;
}

@keyframes aggressive-breathe {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  50% { transform: translate(-50%, -50%) scale(1.08); }
}

@keyframes aggressive-aura {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Ember / spark particles */
.ember {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  z-index: 3;
}

@keyframes ember-rise {
  0% {
    transform: translateY(0) translateX(0) scale(1);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  80% {
    opacity: 0.8;
  }
  100% {
    transform: translateY(-100vh) translateX(var(--ember-drift, 20px)) scale(0.3);
    opacity: 0;
  }
}

/* Background pulse effects */
.pulse-good-effect {
  animation: pulse-good 1.2s ease-out;
}

.pulse-bad-effect {
  animation: pulse-bad 1.2s ease-out;
}

@keyframes pulse-good {
  0% { box-shadow: inset 0 0 0px rgba(34, 197, 94, 0); }
  30% { box-shadow: inset 0 0 120px rgba(34, 197, 94, 0.2), inset 0 0 60px rgba(34, 197, 94, 0.15); }
  60% { box-shadow: inset 0 0 200px rgba(34, 197, 94, 0.12), inset 0 0 80px rgba(34, 197, 94, 0.1); }
  100% { box-shadow: inset 0 0 0px rgba(34, 197, 94, 0); }
}

@keyframes pulse-bad {
  0% { box-shadow: inset 0 0 0px rgba(239, 68, 68, 0); }
  30% { box-shadow: inset 0 0 140px rgba(239, 68, 68, 0.25), inset 0 0 70px rgba(239, 68, 68, 0.2); }
  60% { box-shadow: inset 0 0 220px rgba(239, 68, 68, 0.15), inset 0 0 90px rgba(239, 68, 68, 0.12); }
  100% { box-shadow: inset 0 0 0px rgba(239, 68, 68, 0); }
}

/* ===== Game Log ===== */
.log-entry-icon {
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
  margin-right: 0.5rem;
  margin-top: 0.15rem;
}

.log-entry {
  gap: 0.125rem;
  padding: 0.35rem 0.5rem;
  border-radius: 0.375rem;
  line-height: 1.5;
}

.log-entry:hover {
  background: rgba(255, 255, 255, 0.06);
}

.log-timestamp {
  font-family: 'Courier New', monospace;
  font-size: 0.8rem;
  opacity: 0.6;
  margin-right: 0.35rem;
}

.log-empty-state {
  color: #6b7280;
  font-style: italic;
  text-align: center;
  padding: 1.5rem 0;
}

.log-history-entry {
  transition: background 0.15s ease;
  padding: 0.35rem 0.5rem;
  margin: 0 -0.5rem;
  border-radius: 0.25rem;
}

.log-history-entry:hover {
  background: rgba(255, 255, 255, 0.04);
}

/* ===== Path of Fate ===== */
.path-of-fate {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding: 1rem;
  align-items: center;
  min-height: 120px;
}

/* ===== Flash Lock Overlay ===== */
.flash-lock-overlay {
  animation: flash-lock 0.6s ease-out;
}

@keyframes flash-lock {
  0% { opacity: 0; transform: scale(0.5); }
  50% { opacity: 1; transform: scale(1.1); }
  100% { opacity: 1; transform: scale(1); }
}

/* ===== Animations ===== */
.animate-fade-in {
  animation: fade-in 0.5s ease-out;
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.animate-shake {
  animation: shake 0.5s ease-in-out;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-6px); }
  80% { transform: translateX(6px); }
}

.animate-ai-press {
  animation: ai-press 0.6s ease-in-out;
}

@keyframes ai-press {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(250, 204, 21, 0.6); }
  50% { transform: scale(1.15); box-shadow: 0 0 12px 4px rgba(250, 204, 21, 0.4); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(250, 204, 21, 0); }
}

.animate-log-entry-fade-in {
  animation: log-fade-in 0.4s ease-out;
}

@keyframes log-fade-in {
  from { opacity: 0; transform: translateX(-10px); }
  to { opacity: 1; transform: translateX(0); }
}

.animate-deck-count-pop {
  animation: deck-pop 0.4s ease-out;
}

@keyframes deck-pop {
  0% { transform: scale(1); }
  50% { transform: scale(1.3); color: #fbbf24; }
  100% { transform: scale(1); }
}

.animate-guess-correct {
  animation: guess-correct 0.6s ease-out;
}

@keyframes guess-correct {
  0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
  50% { box-shadow: 0 0 20px 4px rgba(34, 197, 94, 0.5); }
  100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

.animate-guess-incorrect {
  animation: guess-incorrect 0.6s ease-out;
}

@keyframes guess-incorrect {
  0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
  50% { box-shadow: 0 0 20px 4px rgba(239, 68, 68, 0.5); }
  100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* ===== Float animations for blood cells ===== */
@keyframes float1 {
  0% { transform: translate(0, 0) rotate(0deg); }
  33% { transform: translate(20px, -25px) rotate(60deg); }
  66% { transform: translate(30px, -10px) rotate(120deg); }
  100% { transform: translate(30px, -40px) rotate(180deg); }
}

@keyframes float2 {
  0% { transform: translate(0, 0) rotate(0deg); }
  33% { transform: translate(-15px, 20px) rotate(-50deg); }
  66% { transform: translate(-25px, 10px) rotate(-110deg); }
  100% { transform: translate(-25px, 35px) rotate(-180deg); }
}

@keyframes float3 {
  0% { transform: translate(0, 0) rotate(0deg); }
  33% { transform: translate(25px, 15px) rotate(45deg); }
  66% { transform: translate(15px, 30px) rotate(100deg); }
  100% { transform: translate(40px, 25px) rotate(160deg); }
}

@keyframes float4 {
  0% { transform: translate(0, 0) rotate(0deg); }
  33% { transform: translate(-20px, -15px) rotate(-40deg); }
  66% { transform: translate(-30px, -25px) rotate(-95deg); }
  100% { transform: translate(-35px, -30px) rotate(-170deg); }
}

@keyframes float5 {
  0% { transform: translate(0, 0) scale(1) rotate(0deg); }
  25% { transform: translate(15px, -20px) scale(1.1) rotate(50deg); }
  50% { transform: translate(35px, -35px) scale(0.9) rotate(100deg); }
  75% { transform: translate(20px, -50px) scale(1.05) rotate(150deg); }
  100% { transform: translate(45px, -55px) scale(1) rotate(200deg); }
}

@keyframes float6 {
  0% { transform: translate(0, 0) scale(1) rotate(0deg); }
  25% { transform: translate(-20px, 15px) scale(1.08) rotate(-45deg); }
  50% { transform: translate(-40px, 30px) scale(0.92) rotate(-90deg); }
  75% { transform: translate(-25px, 45px) scale(1.03) rotate(-135deg); }
  100% { transform: translate(-50px, 55px) scale(1) rotate(-190deg); }
}

@keyframes float7 {
  0% { transform: translate(0, 0) scale(1) rotate(0deg); }
  25% { transform: translate(30px, 20px) scale(1.06) rotate(35deg); }
  50% { transform: translate(50px, 35px) scale(0.95) rotate(80deg); }
  75% { transform: translate(35px, 50px) scale(1.02) rotate(125deg); }
  100% { transform: translate(55px, 60px) scale(1) rotate(175deg); }
}

@keyframes float8 {
  0% { transform: translate(0, 0) scale(1) rotate(0deg); }
  25% { transform: translate(-25px, -20px) scale(1.07) rotate(-55deg); }
  50% { transform: translate(-45px, -35px) scale(0.93) rotate(-105deg); }
  75% { transform: translate(-30px, -50px) scale(1.04) rotate(-145deg); }
  100% { transform: translate(-55px, -60px) scale(1) rotate(-200deg); }
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.3);
}

::-webkit-scrollbar-thumb {
  background: rgba(127, 29, 29, 0.5);
  border-radius: 5px;
  border: 1px solid rgba(0, 0, 0, 0.2);
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(185, 28, 28, 0.7);
}

/* ===== Accessibility: Reduced Motion ===== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .fog-layer,
  .aggressive-cell-wrapper::before,
  .aggressive-cell-wrapper::after,
  .ember,
  .animated-background::after,
  .btn-glow,
  .btn-turbo-glow,
  .victory-title,
  .defeat-title,
  .defeat-card-reveal,
  .progress-bar-fill-pulsing,
  .free-placement-glow,
  .card-event-badge,
  .animate-event-correct,
  .animate-event-incorrect,
  .animate-event-ace,
  .animate-event-jack,
  .animate-event-queen,
  .animate-event-king,
  .animate-event-kq-bonus,
  .animate-event-trickster,
  .animate-event-bloodsurge {
    animation: none !important;
  }

  .card-flipper {
    transition-duration: 0.2s;
  }
}
