.quest-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  animation: fadeIn 0.8s ease-out;
  align-items: stretch;
}

.quest-list-empty {
  text-align: center;
  padding: 3rem;
  color: var(--earth-brown);
  background: linear-gradient(135deg, var(--parchment-light) 0%, var(--parchment) 100%);
  border-radius: 8px;
  border: 2px solid var(--earth-brown);
  font-family: 'Lora', serif;
  grid-column: 1 / -1;
  animation: slideInUp 0.6s ease-out;
}

.quest-card {
  background: linear-gradient(135deg, var(--parchment) 0%, var(--parchment-light) 100%);
  border-radius: 8px;
  padding: 1.25rem;
  box-shadow: 0 4px 16px rgba(45, 80, 22, 0.15);
  border: 2px solid var(--gold-dark);
  transition: all 0.3s ease;
  position: relative;
  animation: cascade-item;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.quest-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(45, 80, 22, 0.25),
              0 0 15px rgba(218, 165, 32, 0.15);
  border-color: var(--gold);
}

.quest-card-dark-magic {
  background: linear-gradient(135deg, #2a1a1a 0%, #3d2525 100%);
  border-color: var(--dark-red);
  box-shadow: 0 0 20px rgba(199, 37, 78, 0.4), 
              0 0 40px rgba(199, 37, 78, 0.2),
              inset 0 0 10px rgba(199, 37, 78, 0.1);
  color: var(--parchment);
  animation: dangerGlow 2s ease-in-out infinite;
}

.quest-card-dark-magic:hover {
  box-shadow: 0 0 30px rgba(199, 37, 78, 0.6),
              0 0 60px rgba(199, 37, 78, 0.3),
              0 12px 32px rgba(0, 0, 0, 0.4);
  transform: translateY(-4px);
  border-color: #FF6B6B;
}

.quest-card-header {
  margin-bottom: 1rem;
}

.quest-title-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.5rem;
}

.quest-title-row h3 {
  margin: 0;
  color: var(--deep-blue);
  font-size: 1.25rem;
  font-family: 'Cinzel', serif;
  font-weight: 600;
  flex: 1;
  letter-spacing: 0.5px;
}

.quest-card-dark-magic .quest-title-row h3 {
  color: var(--parchment);
}

.quest-badges {
  display: grid;
  gap: 0.45rem;
  margin-top: 0.5rem;
}

.quest-badge-main-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: nowrap;
  min-height: var(--quest-chip-height);
}

.quest-badge-secondary-row {
  display: flex;
  align-items: center;
  min-height: var(--quest-chip-height);
}

.quest-chip {
  min-height: var(--quest-chip-height);
  border-radius: var(--quest-chip-radius);
  padding: 0.35rem var(--quest-chip-padding-x);
  line-height: 1;
}

.quest-chip-icon {
  font-size: 0.95em;
  line-height: 1;
}

.quest-chip-label {
  display: inline-block;
  line-height: 1.2;
  white-space: nowrap;
}

.quest-type-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: linear-gradient(135deg, var(--forest-green-light) 0%, var(--forest-green) 100%);
  color: var(--parchment);
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(45, 80, 22, 0.3);
  transition: all 0.3s ease;
  flex: 1 1 auto;
  min-width: 0;
  justify-content: center;
}

.quest-type-badge:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(45, 80, 22, 0.5);
}

.dark-magic-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: var(--dark-red);
  color: var(--parchment);
  font-size: 0.85rem;
  font-weight: 600;
  animation: pulse 2s ease-in-out infinite;
  box-shadow: 0 0 10px rgba(220, 38, 38, 0.4);
  transition: all 0.3s ease;
  justify-content: center;
}

.dark-magic-badge:hover {
  box-shadow: 0 0 15px rgba(220, 38, 38, 0.8);
}

.priority-ring {
  font-size: 1.2rem;
  display: inline-block;
}

.priority-critical {
  filter: drop-shadow(0 0 3px rgba(220, 38, 38, 0.8));
}

.priority-important {
  filter: drop-shadow(0 0 3px rgba(245, 158, 11, 0.8));
}

.priority-standard {
  filter: drop-shadow(0 0 3px rgba(107, 114, 128, 0.5));
}

.quest-description {
  color: var(--earth-brown);
  margin-bottom: 1rem;
  line-height: 1.6;
  font-family: 'Lora', serif;
  flex: 1 1 auto;
}

.quest-card-dark-magic .quest-description {
  color: var(--parchment-light);
}

.character-quote {
  margin: 1rem 0;
  padding: 1rem;
  background: rgba(218, 165, 32, 0.1);
  border-left: 4px solid var(--gold);
  border-radius: 4px;
  font-style: italic;
  color: var(--deep-blue);
  font-family: 'Cinzel', serif;
}

.quest-card-dark-magic .character-quote {
  background: rgba(139, 0, 0, 0.2);
  border-left-color: var(--dark-red);
  color: var(--parchment);
}

.quest-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  color: var(--earth-brown-light);
  font-family: 'Lora', serif;
  min-height: 1.5rem;
}

.quest-card-dark-magic .quest-meta {
  color: var(--parchment-light);
}

.quest-meta-item {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.quest-location-clickable {
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 4px;
}

.quest-location-clickable:hover {
  color: var(--gold, #DAA520);
  text-decoration-color: var(--gold, #DAA520);
  transform: translateX(2px);
}

.quest-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--quest-action-gap);
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 2px solid var(--earth-brown);
  align-items: stretch;
  margin-top: auto;
}

.quest-action-btn {
  width: 100%;
  height: var(--quest-action-min-height);
  min-height: var(--quest-action-min-height);
  display: inline-flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 0.58rem 0.72rem;
  font-size: 0.84rem;
  line-height: 1.2;
  letter-spacing: 0.2px;
  text-transform: none;
  white-space: normal;
}

.quest-action-btn-complete {
  font-size: 0.78rem;
  line-height: 1.15;
  padding: 0.5rem 0.6rem;
}

.quest-action-spacer {
  width: 100%;
  min-height: var(--quest-action-min-height);
}

.quest-card-dark-magic .quest-actions {
  border-top-color: var(--dark-red);
}

.quest-status {
  display: inline-flex;
  align-items: center;
  font-size: 0.85rem;
  font-weight: 600;
  justify-content: center;
  min-width: 12.5rem;
}

.quest-status-not_yet_begun,
.quest-status-pending {
  background: var(--status-not-yet-begun);
  color: white;
}

.quest-status-the_road_goes_ever_on,
.quest-status-in_progress {
  background: var(--status-road-goes-on);
  color: white;
}

.quest-status-it_is_done,
.quest-status-completed {
  background: var(--status-it-is-done);
  color: white;
}

.quest-status-the_shadow_falls,
.quest-status-blocked {
  background: var(--status-shadow-falls);
  color: white;
}

.btn-sm {
  padding: 0.5rem 0.85rem;
  font-size: 0.9rem;
}

@media (max-width: 680px) {
  .quest-badge-main-row {
    flex-wrap: wrap;
  }

  .quest-status {
    min-width: 0;
  }

  .quest-actions {
    grid-template-columns: 1fr;
  }

  .quest-action-spacer {
    display: none;
  }
}
