/* "Class quests" (Pages/Quests.cshtml, docs/class-quests-page.md). Uses info.css (the nav pills) and badges.css
   (guide-sub, guide-points); the tables, the quest blocks and the class cards are new. Under 600px the tables stack
   into one card per row; js/quests.js gives each cell its column's name (data-label). */
.panel > p { line-height: 1.65; }
.panel > p:first-of-type { margin-top: 0; }

/* The tables */
.cq-table td { vertical-align: top; line-height: 1.5; }
.cq-table td:first-child { white-space: nowrap; color: var(--accent-hi); font-weight: 600; font-variant-numeric: tabular-nums; }
.cq-table td a { color: #fff; font-weight: 600; }
.cq-table .num { white-space: nowrap; }
.cq-npc { display: block; color: var(--faint); font-size: 0.8rem; }
.cq-plus { display: block; color: var(--faint); font-size: 0.78rem; font-weight: 400; }
.cq-elf td:nth-child(2), .cq-wings td:first-child { color: #fff; font-weight: 600; }
.cq-elf td:nth-child(3) { color: var(--muted); }
.cq-exp { white-space: nowrap; font-variant-numeric: tabular-nums; }
.cq-extra { display: block; color: #fcd34d; font-size: 0.8rem; }

/* One quest */
.cq-quest { margin-top: 1rem; padding-top: 0.2rem; scroll-margin-top: 90px; }
.cq-quest + .cq-quest { border-top: 1px solid var(--line); padding-top: 0.8rem; }
section[id], article[id], #elf-quests { scroll-margin-top: 90px; }

/* Marlon's four towns */
.cq-towns {
    list-style: none;
    margin: 0.2rem 0 0.4rem;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.cq-towns li {
    padding: 6px 12px;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    color: #fff;
    font-size: 0.86rem;
}
.cq-towns span { color: var(--faint); font-variant-numeric: tabular-nums; }

/* The class cards */
.cq-classes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 12px;
    margin-top: 0.6rem;
}
.cq-class {
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.25);
}
.cq-class:target { border-color: var(--accent-line); background: rgba(143, 123, 255, 0.08); }
.cq-class-head { display: flex; gap: 12px; align-items: center; }
.cq-class-head img {
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    border-radius: 10px;
    object-fit: cover;
    object-position: center 20%;
    border: 1px solid var(--line-strong);
}
.cq-class-name { margin: 0; text-align: left; color: #fff; font-size: 1rem; letter-spacing: 0; }
.cq-class-line { margin: 2px 0 0; color: var(--muted); font-size: 0.82rem; line-height: 1.45; }
.cq-class-line b { color: var(--accent-hi); font-weight: 600; }
.cq-facts {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 6px 12px;
    margin: 10px 0 0;
    font-size: 0.84rem;
    line-height: 1.45;
}
.cq-facts dt { color: var(--faint); }
.cq-facts dd { margin: 0; color: var(--text); min-width: 0; }

.cq-more { margin-top: 20px; }

@media (max-width: 600px) {
    .cq-classes { grid-template-columns: 1fr; }
    .cq-facts { grid-template-columns: 1fr; gap: 2px; }
    .cq-facts dd { margin-bottom: 6px; }

    /* Tables become one card per row */
    .cq-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
    .cq-table, .cq-table tbody, .cq-table tr, .cq-table td { display: block; width: 100%; }
    .cq-table tr { padding: 10px 0; border-bottom: 1px solid var(--line-strong); }
    .cq-table td { border: 0; padding: 3px 2px; text-align: left; white-space: normal; }
    .cq-table td.num, .cq-table .cq-exp { white-space: normal; }
    .cq-table td[data-label]::before {
        content: attr(data-label);
        display: block;
        color: var(--faint);
        font-size: 0.68rem;
        letter-spacing: 0.08em;
        text-transform: uppercase;
    }
    .cq-table td:first-child::before { display: inline; margin-right: 6px; }
}
