/**
 * Quest cards — the entry list and the detail pane.
 *
 * ⚠️ SPLIT OUT OF `quest-log.css` SO TWO PAGES CAN SHARE ONE DEFINITION. The
 * Field Journal grew a read-only quest tab ([D-53]) and the owner asked for the
 * quest log's look rather than the hex lattice. Copying the rules would have
 * left two stylesheets to keep in step, and the one that drifted would be the
 * one a player was looking at.
 *
 * ⚠️ THE PAGE SHELL STAYED BEHIND, AND HAD TO. `quest-log.css` styles
 * `.journal-page` as a sheet of parchment — and `.journal-page` is the FIELD
 * JOURNAL'S ROOT ELEMENT. Loading that file on `/journal` would repaint the
 * whole hex journal as a cream page. Only the card rules are here, and none of
 * them collide.
 *
 * ⚠️ THESE RULES ASSUME PARCHMENT UNDER THEM — the type is dark brown on cream.
 * Anything mounting them must provide `.quest-sheet` (below) as its ground, or
 * the text lands dark-on-dark and reads as missing.
 */

/**
 * The parchment ground. Lives here rather than in `quest-log.css` because both
 * surfaces need it; the quest log's own pages wear it as a second class so
 * there is still only one copy of the gradient.
 */
.quest-sheet {
  padding: 30px;
  position: relative;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.1) 0%, transparent 5%, transparent 95%, rgba(0, 0, 0, 0.1) 100%),
    linear-gradient(180deg, #f5e6c8 0%, #e8d5b0 100%);
  color: #3d3225;
}

.tab-icon {
  display: inline-block;
  width: 18px;
  height: 18px;
  line-height: 18px;
  text-align: center;
  background: rgba(212, 175, 55, 0.2);
  border-radius: 50%;
  margin-right: 6px;
  font-size: 0.8em;
}
.filter-btn {
  padding: 4px 12px;
  background: rgba(61, 50, 37, 0.1);
  border: 1px solid #c9b896;
  border-radius: 12px;
  color: #5a4a35;
  font-size: 0.75em;
  cursor: pointer;
  transition: all 0.2s;
}
.filter-btn:hover {
  background: rgba(61, 50, 37, 0.2);
}
.filter-btn.active {
  background: #3d2914;
  color: #f5e6c8;
  border-color: #3d2914;
}
/* Quest List */
.quest-list {
  max-height: 380px;
  overflow-y: auto;
  padding-right: 10px;
}
/* Rotation group headers (item 21): Today's Tasks / This Week / Journal */
.quest-group-header {
  font-family: 'Georgia', serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #6b5a3e;
  border-bottom: 1px solid #c9b896;
  padding: 4px 2px;
  margin: 12px 0 8px;
}
.quest-group-header:first-child {
  margin-top: 0;
}
.quest-entry {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.3);
  border: 1px solid #c9b896;
  border-left: 4px solid var(--quest-color, #8b7355);
  border-radius: 4px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: all 0.2s;
}
.quest-entry:hover {
  background: rgba(255, 255, 255, 0.5);
  transform: translateX(3px);
}
.quest-entry.selected {
  background: rgba(212, 175, 55, 0.2);
  border-color: #d4af37;
}
.quest-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(61, 41, 20, 0.8);
  color: #d4af37;
  border-radius: 50%;
  font-size: 1em;
}
.quest-info {
  flex: 1;
}
.quest-name {
  font-family: 'Georgia', serif;
  color: #3d2914;
  font-size: 0.95em;
  margin: 0 0 4px 0;
}
.quest-category {
  font-size: 0.7em;
  color: #7a6b55;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.repeatable-badge {
  display: inline-block;
  font-size: 0.65em;
  color: #3498db;
  background: rgba(52, 152, 219, 0.1);
  padding: 2px 6px;
  border-radius: 8px;
  margin-left: 8px;
}
/**
 * ⚠️ `overflow: visible`, AND THE COUNT WAS INVISIBLE UNTIL IT WAS.
 *
 * `.progress-text` is positioned `top: -14px` — deliberately, so the tally sits
 * above the bar rather than inside a 4px-tall box. But this rule clipped it:
 * a 4px box with `overflow: hidden` throws away everything at a negative offset,
 * so "2/3" has never been drawn on the quest board either. Found when the same
 * rules were mounted in the Field Journal ([D-53]) and the bar showed a count
 * that was not there.
 *
 * Clipping is not needed: `.progress-bar` carries its own `border-radius`, so
 * the fill is already rounded without the parent cutting it.
 *
 * The margin makes room for the tally instead of letting it land on the
 * category line above.
 */
.progress-indicator {
  height: 4px;
  background: rgba(0, 0, 0, 0.1);
  border-radius: 2px;
  margin-top: 18px;
  position: relative;
  overflow: visible;
}
.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #d4af37, #aa8a2e);
  border-radius: 2px;
  transition: width 0.3s;
}
.progress-text {
  position: absolute;
  right: 0;
  top: -14px;
  font-size: 0.65em;
  color: #7a6b55;
}
.empty-message {
  text-align: center;
  padding: 40px 20px;
  color: #7a6b55;
  font-style: italic;
}
/* Quest Details */
.quest-details {
  color: #3d2914;
}
.quest-detail-header {
  margin-bottom: 20px;
}
.quest-category-tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.7em;
  color: white;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}
.quest-title {
  font-family: 'Georgia', serif;
  font-size: 1.5em;
  color: #3d2914;
  margin: 0;
  line-height: 1.2;
}
.repeatable-tag {
  display: inline-block;
  font-size: 0.7em;
  color: #3498db;
  margin-top: 5px;
}
.quest-description {
  margin-bottom: 20px;
  padding: 15px;
  background: rgba(255, 255, 255, 0.4);
  border-radius: 4px;
  border-left: 3px solid #c9b896;
}
.long-desc {
  font-size: 0.9em;
  line-height: 1.6;
  color: #5a4a35;
  margin: 0;
}
.quest-objectives h3,
.quest-rewards h3,
.quest-notes h3 {
  font-family: 'Georgia', serif;
  font-size: 1em;
  color: #3d2914;
  margin: 0 0 10px 0;
  border-bottom: 1px solid #c9b896;
  padding-bottom: 5px;
}
.objective-list {
  list-style: none;
  padding: 0;
  margin: 0 0 20px 0;
}
.objective {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px dashed #ddd5c0;
}
.objective.completed {
  opacity: 0.6;
}
.objective.completed .objective-text {
  text-decoration: line-through;
}
.objective-check {
  color: #8b7355;
  font-size: 1em;
}
.objective.completed .objective-check {
  color: #27ae60;
}
.objective-text {
  font-size: 0.85em;
  color: #5a4a35;
}
.rewards-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}
.reward-item {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  background: rgba(212, 175, 55, 0.2);
  border: 1px solid #d4af37;
  border-radius: 4px;
  font-size: 0.85em;
  color: #3d2914;
}
.reward-icon {
  font-size: 1.1em;
}
/* A reward item's icon may be a sprite path rather than an emoji (v1.0.188) —
   `training_sword` on weekly_trial_rivals is a live example. */
.reward-icon .item-icon-img {
  width: 1.1em;
  height: 1.1em;
  vertical-align: -0.2em;
}
/* Notes Section */
.quest-notes {
  margin-bottom: 20px;
}
.notes-textarea {
  width: 100%;
  min-height: 80px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid #c9b896;
  border-radius: 4px;
  font-family: 'Georgia', serif;
  font-size: 0.85em;
  color: #3d2914;
  resize: vertical;
}
.notes-textarea:focus {
  outline: none;
  border-color: #d4af37;
}
.notes-hint {
  font-size: 0.7em;
  color: #8b7355;
  margin-top: 5px;
  font-style: italic;
}
/* Quest Actions */
.quest-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}
.completion-info {
  font-size: 0.8em;
  color: #7a6b55;
  font-style: italic;
  margin: 0;
}
.rewards-received {
  padding: 15px;
  background: rgba(212, 175, 55, 0.1);
  border-radius: 4px;
}
.rewards-received p {
  margin: 8px 0;
  color: #3d2914;
}
.error {
  color: #c0392b;
}
.incomplete-list {
  text-align: left;
  margin-top: 10px;
  padding-left: 20px;
  color: #5a4a35;
}
/* Scrollbar for journal pages */
.quest-list::-webkit-scrollbar {
  width: 8px;
}
.quest-list::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.1);
  border-radius: 4px;
}
.quest-list::-webkit-scrollbar-thumb {
  background: #c9b896;
  border-radius: 4px;
}
.quest-list::-webkit-scrollbar-thumb:hover {
  background: #b5a382;
}
