/* Project Card */
.project-card {
  background: var(--bg-surface);
  border: 1px solid var(--bg-elevated);
  border-radius: var(--radius);
  padding: 1.25rem;
  cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.project-card:hover {
  border-color: var(--color-gold);
  box-shadow: 0 0 12px rgba(201, 176, 55, 0.15);
  animation: emberGlow 2s ease-in-out infinite;
}

.project-card__name {
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--color-text);
  letter-spacing: 0.05em;
}

.project-card__stats {
  font-size: 0.8rem;
  color: var(--color-muted);
  display: flex;
  gap: 1rem;
}

.project-card__completed {
  opacity: 0.5;
}

.project-card__completed .project-card__name::after {
  content: ' — COMPLETED';
  color: var(--color-gold);
  font-size: 0.75rem;
}

/* HP Bar */
.hp-bar {
  width: 100%;
  height: 8px;
  background: var(--bg-primary);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.hp-bar__fill {
  height: 100%;
  border-radius: 4px;
  transition: width 400ms ease, background-color 400ms ease;
}

.hp-bar--gold .hp-bar__fill { background: var(--color-gold); }
.hp-bar--orange .hp-bar__fill { background: var(--color-orange); }
.hp-bar--red .hp-bar__fill { background: var(--color-red); }

.hp-bar.damage .hp-bar__fill {
  animation: damageFlash 200ms ease;
}

/* HP Bar Large (Dungeon View) */
.hp-bar--large {
  height: 14px;
  border-radius: 6px;
}

.hp-bar--large .hp-bar__fill {
  border-radius: 6px;
}

.hp-label {
  font-size: 0.8rem;
  color: var(--color-muted);
  text-align: right;
  margin-top: 0.25rem;
}

/* Task Card */
.task-card {
  background: var(--bg-surface);
  border: 1px solid var(--bg-elevated);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.task-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.task-card__type {
  font-size: 0.75rem;
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
  flex-shrink: 0;
}

.task-card__type--mob { background: var(--bg-elevated); color: var(--color-muted); }
.task-card__type--mini { background: rgba(204, 102, 0, 0.2); color: var(--color-orange); }
.task-card__type--boss { background: rgba(201, 176, 55, 0.2); color: var(--color-gold); }

.task-card__name {
  font-family: var(--font-display);
  font-size: 0.95rem;
  flex: 1;
}

.task-card__substep {
  font-size: 0.8rem;
  color: var(--color-muted);
}

.task-card__action {
  align-self: flex-end;
}

/* Task Card Date */
.task-card__date {
  font-size: 0.7rem;
  color: var(--color-muted);
  opacity: 0.7;
}

.task-card.bloodstain .task-card__date {
  color: var(--color-red);
  opacity: 1;
}

/* Task Card Bloodstain */
.task-card.bloodstain {
  animation: bloodstainPulse 3s ease-in-out infinite;
  border-color: var(--color-red);
}

/* Task Card Blocked (Fog Gate) */
.task-card.blocked {
  position: relative;
  pointer-events: none;
}

.task-card.blocked .delete-btn,
.task-card.blocked > div:last-child {
  pointer-events: auto;
}

.task-card.blocked .fog-overlay {
  position: absolute;
  inset: 0;
  background: var(--color-fog);
  backdrop-filter: blur(4px);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  font-family: var(--font-display);
  color: var(--color-muted);
  letter-spacing: 0.1em;
  font-size: 0.85rem;
  z-index: 2;
}

.task-card.blocked .fog-overlay .fog-label {
  font-size: 0.7rem;
  opacity: 0.7;
}

.fog-dissolve {
  animation: fogDissolve 800ms ease forwards;
  pointer-events: none;
}

/* Open Mode dashed line */
.task-card__open-line {
  border-top: 2px dashed var(--color-muted);
  margin: 0.5rem 0;
}

/* Estimated Mode blurred HP bar edge */
.hp-bar--estimated .hp-bar__fill {
  mask-image: linear-gradient(to right, black 80%, transparent 100%);
  -webkit-mask-image: linear-gradient(to right, black 80%, transparent 100%);
}

/* Task Card Defeated */
.task-card.defeated {
  opacity: 0.4;
  border-color: transparent;
}

.task-card.defeated .task-card__name {
  text-decoration: line-through;
  color: var(--color-muted);
}

.task-card.defeated .task-card__felled {
  font-family: var(--font-display);
  font-size: 0.75rem;
  color: var(--color-gold);
  letter-spacing: 0.1em;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1.25rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 600;
  transition: all var(--transition);
}

.btn--primary {
  background: var(--color-gold);
  color: var(--bg-primary);
}

.btn--primary:hover {
  background: #d4bb3f;
}

.btn--ghost {
  border: 1px solid var(--bg-elevated);
  color: var(--color-muted);
}

.btn--ghost:hover {
  border-color: var(--color-text);
  color: var(--color-text);
}

.btn--defeat {
  background: transparent;
  border: 1px solid var(--color-gold);
  color: var(--color-gold);
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
}

.btn--defeat:hover {
  background: rgba(201, 176, 55, 0.1);
}

.btn--small {
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
}

/* Modal */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  z-index: 100;
  justify-content: center;
  align-items: center;
  padding: 1rem;
}

.modal-overlay.active {
  display: flex;
}

.modal {
  background: var(--bg-surface);
  border: 1px solid var(--bg-elevated);
  border-radius: var(--radius);
  padding: 1.5rem;
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.modal__title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--color-gold);
}

.modal__field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.modal__field label {
  font-size: 0.8rem;
  color: var(--color-muted);
}

.modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

/* Type Selector */
.type-selector {
  display: flex;
  gap: 0.5rem;
}

.type-selector__option {
  flex: 1;
  padding: 0.5rem;
  text-align: center;
  border: 1px solid var(--bg-elevated);
  border-radius: var(--radius);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all var(--transition);
}

.type-selector__option:hover {
  border-color: var(--color-muted);
}

.type-selector__option.active {
  border-color: var(--color-gold);
  color: var(--color-gold);
}

/* Defeat Screen Content */
.defeat__message {
  font-family: var(--font-display);
  font-size: 2.5rem;
  color: var(--color-gold);
  letter-spacing: 0.15em;
  animation: defeatFadeIn 2.5s ease forwards;
  opacity: 0;
}

.defeat__task-name {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--color-text);
  animation: defeatFadeIn 2.5s ease 0.5s forwards;
  opacity: 0;
}

.defeat__quote {
  font-size: 0.95rem;
  color: var(--color-muted);
  font-style: italic;
  max-width: 400px;
  animation: defeatFadeIn 2.5s ease 1s forwards;
  opacity: 0;
}

.defeat__continue {
  animation: defeatFadeIn 2s ease 2s forwards;
  opacity: 0;
}

/* Delete Button */
.delete-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  width: 1.5rem;
  height: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: var(--color-muted);
  font-size: 0.75rem;
  cursor: pointer;
  opacity: 0;
  transition: all var(--transition);
  z-index: 3;
}

.region-header .delete-btn {
  position: static;
  width: auto;
  height: auto;
  padding: 0.1rem 0.35rem;
}

.project-card:hover ~ .delete-btn,
div:hover > .delete-btn,
.region-header:hover .delete-btn,
.task-card:hover .delete-btn,
.delete-btn:hover {
  opacity: 1;
}

.delete-btn:hover {
  color: var(--color-red);
  border-color: var(--color-red);
  background: rgba(204, 51, 51, 0.1);
}

/* Danger Button (Confirm Modal) */
.btn--danger {
  background: var(--color-red);
  color: var(--color-text);
  border: none;
}

.btn--danger:hover {
  background: #e04444;
}

/* Quick-Add Task List */
.quick-add__list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  max-height: 200px;
  overflow-y: auto;
}

.quick-add__item {
  font-size: 0.8rem;
  color: var(--color-muted);
  padding: 0.25rem 0;
  border-bottom: 1px solid var(--bg-elevated);
}

.quick-add__item span {
  color: var(--color-text);
}

/* Quick-Add Batch Textarea */
#quick-add-batch {
  width: 100%;
  resize: vertical;
  min-height: 120px;
  font-size: 0.85rem;
  line-height: 1.6;
}
