/*
 * Questlines (server/questlines.php). The quest givers drawn as the game draws them (img/questlines, their own
 * sprites, never smoothed) carry the page: the journey's stops, the town and region tiles, the givers of a hub.
 * One level of boxing inside a panel (website design rules): tiles, steps and cards are 6px, flat, bordered.
 */

.ql-sprite { image-rendering: pixelated; display: block; max-width: 100%; height: auto; }

/* The guide's reading width (72ch) and list indent are for running text: these pages fill their panels. */
.rcp-wiki-section > p,
.rcp-wiki-section > ul,
.rcp-wiki-section > ol,
.rcp-wiki-section .rcp-wiki-lede { max-width: none; }
.rcp-wiki-section .ql-journey,
.rcp-wiki-section .ql-grid,
.rcp-wiki-section .ql-givers,
.rcp-wiki-section .ql-steps,
.rcp-wiki-section .ql-cards,
.rcp-wiki-section .ql-objs { padding-left: 0; }

/* ---- The journey: five stops in a row, joined by a line ---- */

.ql-journey {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  position: relative;
}
.ql-journey::before {
  content: "";
  position: absolute;
  left: 10%;
  right: 10%;
  top: 104px;
  border-top: 2px dashed rgba(142, 197, 255, 0.28);
}
.ql-stop { min-width: 0; position: relative; }
.ql-stop-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  height: 100%;
  padding: 10px 8px 12px;
  border-radius: 6px;
  color: var(--text-muted);
  text-decoration: none;
}
.ql-stop-link:hover,
.ql-stop-link:focus-visible { background: rgba(255, 255, 255, 0.04); text-decoration: none; }
.ql-stop-pic {
  height: 92px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  font-size: 0;
}
.ql-stop-pic img { max-height: 92px; width: auto; }
.ql-stop-n {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  margin: 2px 0 8px;
  border-radius: 50%;
  background: var(--bg-cream);
  border: 2px solid var(--accent);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
}
.ql-stop-name { color: var(--text); font-weight: 700; font-size: 14px; }
.ql-stop-lv { margin-top: 2px; font-size: 12px; color: var(--accent); }
.ql-stop-text { margin-top: 6px; font-size: 12px; line-height: 1.5; }

/* ---- Tiles: a job town or a region, its main contact beside its name ---- */

.ql-grid {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 8px;
}
.ql-tile {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  height: 100%;
  padding: 8px 12px 8px 8px;
  border-radius: 6px;
  border: 1px solid rgba(140, 170, 210, 0.18);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-muted);
  text-decoration: none;
}
.ql-tile:hover,
.ql-tile:focus-visible { border-color: rgba(142, 197, 255, 0.55); background: rgba(142, 197, 255, 0.06); text-decoration: none; }
.ql-tile-pic {
  height: 76px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  font-size: 0;
}
.ql-tile-pic img { max-height: 76px; max-width: 64px; width: auto; }
.ql-tile-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ql-tile-name { color: var(--text); font-weight: 700; font-size: 14px; }
.ql-tile-lv { color: var(--accent); font-size: 12px; }
.ql-tile-sub { font-size: 12px; line-height: 1.4; }

/* ---- A region: its hubs, each opened by its main contact ---- */

.ql-jump { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 12px 0 0; font-size: 13px; }

.ql-hubhead {
  display: grid;
  grid-template-columns: 80px minmax(0, 1fr);
  gap: 16px;
  align-items: end;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(160, 190, 255, 0.12);
}
.ql-hubhead-pic { height: 96px; display: flex; align-items: flex-end; justify-content: center; font-size: 0; }
.ql-hubhead-pic img { max-height: 96px; max-width: 80px; width: auto; }
.ql-hubhead h3 { margin: 0; }
.ql-hubhead-meta { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 0; }
.ql-hubhead-text { margin: 8px 0 0; color: var(--text-muted); font-size: 13px; line-height: 1.55; }

/* The givers: a figure each, standing on a shared floor line. */
.ql-givers {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 8px;
}
.ql-giver {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 8px 6px 10px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.03);
  min-width: 0;
}
.ql-giver-pic { height: 84px; display: flex; align-items: flex-end; justify-content: center; font-size: 0; }
.ql-giver-pic img { max-height: 84px; max-width: 110px; width: auto; }
.ql-giver-name { margin-top: 6px; color: var(--text); font-weight: 700; font-size: 13px; }
.ql-giver-title { font-size: 12px; color: var(--text-muted); }
.ql-giver-where { margin-top: 4px; font-size: 12px; color: var(--text-muted); }
.ql-giver-where .rcp-navi { margin-left: 2px; }

/* The questline: numbered steps down a line, each step's quests side by side. */
.ql-steps { list-style: none; margin: 10px 0 0; padding: 0; position: relative; }
.ql-step {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 12px;
  position: relative;
  padding-bottom: 10px;
}
.ql-step:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 14px;
  top: 30px;
  bottom: 0;
  border-left: 2px solid rgba(142, 197, 255, 0.22);
}
.ql-step-n {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  background: var(--bg-cream);
}
.ql-cards {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 8px;
}
.ql-cards--row { margin-top: 8px; }
.ql-sub { margin: 12px 0 0; color: var(--text); font-weight: 700; font-size: 13px; }

.ql-card {
  padding: 9px 12px 10px;
  border-radius: 6px;
  border: 1px solid rgba(140, 170, 210, 0.18);
  background: rgba(255, 255, 255, 0.03);
  min-width: 0;
}
.ql-card p { margin: 0; }
.ql-card-head { display: flex; align-items: baseline; gap: 8px; }
.ql-card-title { flex: 1 1 auto; min-width: 0; color: var(--text); font-weight: 700; }
.ql-lv {
  flex: none;
  padding: 1px 7px;
  border-radius: 6px;
  background: rgba(142, 197, 255, 0.12);
  color: var(--accent);
  font-size: 11px;
  white-space: nowrap;
}
.ql-card-meta { margin-top: 2px; font-size: 12px; color: var(--text-muted); }
.ql-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px !important; }
.ql-tag {
  padding: 1px 7px;
  border-radius: 6px;
  border: 1px solid rgba(140, 170, 210, 0.26);
  font-size: 11px;
  color: var(--text-muted);
}
.ql-tag--repeat { border-color: rgba(232, 182, 76, 0.5); color: #f0c877; }
.ql-tag--class { border-color: rgba(142, 197, 255, 0.4); color: var(--accent); }
.ql-tag--end { border-color: rgba(127, 214, 164, 0.45); color: #7fd6a4; }

.ql-objs { list-style: none; margin: 8px 0 0; padding: 8px 0 0; display: grid; gap: 4px; font-size: 12px; border-top: 1px solid rgba(160, 190, 255, 0.1); }
/* Marker, label, count on one row; the map under the label. A long label wraps beside its marker. */
.ql-objs li {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 8px;
  min-width: 0;
  color: var(--text-muted);
}
.ql-objs li .ql-obj-map { grid-column: 2 / -1; margin-top: -2px; }
.ql-icon { width: 24px; height: 24px; image-rendering: pixelated; flex: 0 0 auto; }
.ql-dot { width: 24px; height: 24px; flex: 0 0 auto; display: grid; place-items: center; font-size: 0; }
.ql-dot::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: rgba(142, 197, 255, 0.55); }
.ql-obj-label { color: rgba(241, 246, 255, 0.86); }
.ql-obj-n { padding: 0 6px; border-radius: 6px; background: rgba(255, 255, 255, 0.06); color: var(--text); }
.ql-obj-map { font-size: 11px; }

.ql-comm td { white-space: nowrap; }
.ql-comm td:last-child { white-space: normal; }

/* Named monsters: the base monster's sprite beside the name. */
.ql-named { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; margin-top: 8px; }
.ql-mob {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 10px;
  align-items: center;
  padding: 6px 10px 6px 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  font-size: 12px;
}
.ql-mob-pic { grid-row: 1 / 3; width: 56px; height: 56px; display: grid; place-items: center; font-size: 0; }
.ql-mob-pic img { max-width: 56px; max-height: 56px; image-rendering: pixelated; }
.ql-mob-name { color: var(--text); font-weight: 700; font-size: 13px; align-self: end; }
.ql-mob-facts { color: var(--text-muted); align-self: start; }

@media (max-width: 900px) {
  .ql-journey { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .ql-journey::before { display: none; }
  .ql-stop-link { display: grid; grid-template-columns: 64px minmax(0, 1fr); grid-template-rows: auto auto auto; column-gap: 12px; text-align: left; align-items: center; }
  .ql-stop-pic { grid-row: 1 / 4; height: 72px; }
  .ql-stop-pic img { max-height: 72px; }
  .ql-stop-n { display: none; }
  .ql-stop-text { margin-top: 2px; }
}

@media (max-width: 520px) {
  .ql-named { grid-template-columns: minmax(0, 1fr); }
  .ql-comm td { white-space: normal; }
  .ql-hubhead { grid-template-columns: 56px minmax(0, 1fr); }
  .ql-hubhead-pic { height: 72px; }
  .ql-hubhead-pic img { max-height: 72px; max-width: 56px; }
}
