/* Danh tab (Prompts #18 + #20 + #23): one shopping-list table grouped by purpose, one line per item, To use and
   Cooldown columns (chips: potion / bomb / own / trinket), craft-or-buy cell, make-it prices, note rows. Only what
   style.css does not have. */
table.danh { width: 100%; min-width: 1000px; border-collapse: collapse; font-size: 14px; }
table.danh th, table.danh td { padding: 6px 10px; border-top: 1px solid #1d2336; text-align: left; vertical-align: middle;
  white-space: nowrap; }
table.danh thead th { border-top: 0; color: var(--muted); font-size: 13px; font-weight: 700; }
table.danh .num { text-align: right; font-variant-numeric: tabular-nums; }
table.danh td.need { color: var(--ink); font-weight: 700; }
/* the item column stays in view while the rest scrolls sideways on a phone */
table.danh .item { position: sticky; left: 0; z-index: 1; background: var(--panel); }
table.danh thead th:first-child { position: sticky; left: 0; z-index: 2; background: var(--panel); }
table.danh .item .name { font-size: 15px; font-weight: 700; overflow-wrap: normal; }
table.danh tr.bn .name { color: var(--q0); text-decoration: line-through; }
/* Prompt #21: an icon on every row and rows tall enough that the name reads at a glance */
table.danh .dn-it { display: inline-flex; align-items: center; gap: 10px; }
table.danh .icon.dn-ic { width: 28px; height: 28px; flex: none; border-radius: 4px; }
table.danh tr.bn .icon.dn-ic { filter: grayscale(1) brightness(.7); }
/* purpose group header: the label stays at the left edge while the table scrolls */
table.danh tr.grp th { padding: 13px 10px 5px; border-top: 1px solid var(--line); color: var(--gold);
  font: 700 14px var(--caps); letter-spacing: .06em; }
table.danh tbody tr.grp:first-child th { border-top: 0; padding-top: 8px; }
table.danh tr.grp th span { position: sticky; left: 10px; }
.dn-chip { display: inline-block; padding: 0 8px; border: 1px solid currentColor; border-radius: 999px;
  font-size: 12px; line-height: 18px; }
.dn-chip.c-potion { color: #8fc8ff; }
.dn-chip.c-bomb { color: #ffad5c; }
.dn-chip.c-own { color: var(--muted); }
/* Prompt #23: the trinket chip, the own-cooldown time, the use requirement (red when Danh's skill is lower), the cheaper
   alternative under the name, "make it" prices, and the full-width note rows */
.dn-chip.c-trinket { color: #d8b4ff; }
table.danh .cdt { font-variant-numeric: tabular-nums; margin-right: 2px; }
table.danh .low, .danh-note .low { color: #ff8a80; }
table.danh .dn-nm { display: inline-block; }
table.danh .dn-alt { display: block; font-size: 12px; color: var(--muted); font-weight: 400; white-space: nowrap; }
table.danh .dn-alt .name { font-size: 12px; font-weight: 700; }
table.danh .mk { color: var(--green); }
table.danh .cr .v-make { color: var(--green); }
table.danh tr.dn-note td { white-space: normal; padding: 2px 10px 9px; border-top: 0; font-size: 13px; color: var(--muted); }
table.danh .dn-note-in { position: sticky; left: 10px; max-width: min(760px, calc(100vw - 70px)); }   /* fits 641-800 px too, with a desktop scrollbar */
table.danh .dn-note-in a { color: var(--gold); white-space: nowrap; }
.danh-make { margin: 4px 12px 6px; padding-left: 18px; font-size: 13px; color: var(--ink); }
.danh-make li { margin: 2px 0; }
table.danh .cr { font-variant-numeric: tabular-nums; }
table.danh .cr .v { font-weight: 700; }
table.danh .cr .v-craft { color: var(--green); }
table.danh .cr .v-buy { color: var(--ink); }
table.danh .cr .v-either { color: var(--muted); }
@media (hover: hover) and (pointer: fine) { table.danh [title] { cursor: help; } table.danh a[title] { cursor: pointer; } }
.danh-sum { margin: 10px 12px 4px; color: var(--ink); }
.danh-note { margin: 4px 12px 10px; font-size: 13px; color: var(--muted); }
section.card.danh-card { margin-bottom: 40px; }      /* Prompt #22: the footer pulse line that gave this space moved to the badge */

@media (max-width: 640px) {
  table.danh { font-size: 13px; min-width: 780px; }
  table.danh th, table.danh td { padding: 6px 7px; }
  /* a long name may take a second line on a phone (still one row, no secondary text) so the numbers keep room */
  table.danh .item { white-space: normal; min-width: 170px; max-width: 170px; }   /* Prompt #23: the 170 px the column had before the two new columns took its slack (border-box: padding included) */
  table.danh .item .name { font-size: 14px; }
  /* the Prompt #20 column width stays (To buy in first view at 390 px); a smaller icon leaves the name two lines at most */
  table.danh .dn-it { gap: 6px; }
  table.danh .icon.dn-ic { width: 22px; height: 22px; }
  table.danh tr.grp th { font-size: 13px; }
  table.danh tr.grp th span { left: 7px; }
  /* Prompt #23: the note stays inside the first view while the table scrolls sideways (100vw - gutters - borders) */
  table.danh tr.dn-note td { padding: 2px 7px 8px; }
  table.danh .dn-note-in { left: 7px; max-width: calc(100vw - 48px); }
  table.danh .dn-alt { white-space: normal; }
  table.danh .dn-alt .name { font-size: 12px; }      /* after .item .name (14px): the alternative stays small */
}
/* Prompt #23 review: between phone and wide desktop the two new columns would push Craft or buy off the card: the long
   cells may take a second line instead, so the table fits from about 960 px up (below that it scrolls sideways, one
   line per row, like on a phone) */
@media (min-width: 960px) and (max-width: 1259px) {
  table.danh { min-width: 0; }
  table.danh .item { white-space: normal; min-width: 180px; max-width: 230px; }
  table.danh td.use, table.danh td.cdg, table.danh td.cr { white-space: normal; min-width: 110px; }
}

/* Prompt #24: the Gold card at the top of the Danh tab (ForeverGold's danh_card.json): one stats row, tonight's line,
   Scarce as a 6-row table with icons, Craft and Sell as short rows side by side (stacked on a phone); no paragraphs */
section.card.gold-card { margin-bottom: 14px; }
.gold-card .gc-stats { display: flex; flex-wrap: wrap; gap: 6px 22px; padding: 9px 12px 2px; color: var(--muted); font-size: 14px; }
.gold-card .gc-stats b { color: var(--gold); font-size: 17px; font-variant-numeric: tabular-nums; margin-right: 3px; }
.gold-card .gc-tonight { margin: 6px 12px 8px; display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--ink); }
.gold-card .gc-tonight b { color: var(--gold); }
.gold-card .icon.gc-ic { width: 20px; height: 20px; flex: none; border-radius: 3px; }
table.gc-scarce { width: 100%; border-collapse: collapse; font-size: 14px; }
table.gc-scarce th, table.gc-scarce td { padding: 5px 10px; border-top: 1px solid #1d2336; text-align: left; white-space: nowrap; vertical-align: middle; }
table.gc-scarce thead th { border-top: 0; color: var(--muted); font-size: 13px; font-weight: 700; }
table.gc-scarce .num { text-align: right; font-variant-numeric: tabular-nums; }
table.gc-scarce .item .name { font-weight: 700; text-decoration: none; color: var(--ink); }
table.gc-scarce td.gc-do { white-space: normal; color: var(--ink); min-width: 160px; }
table.gc-scarce .gc-do-m { display: none; }
.gold-card .gc-it { display: inline-flex; align-items: center; gap: 7px; min-width: 0; }
.gold-card .gc-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; padding: 4px 12px 10px; }
.gold-card .gc-list h3 { margin: 6px 0 2px; font: 700 13px var(--caps); letter-spacing: .06em; color: var(--gold); }
.gold-card .gc-list ul { list-style: none; margin: 0; padding: 0; }
.gold-card .gc-list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 3px 0;
  border-top: 1px solid #1d2336; font-size: 13px; }
.gold-card .gc-list .name { font-weight: 700; text-decoration: none; color: var(--ink); overflow-wrap: anywhere; }
.gold-card .gc-fig { color: var(--muted); font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
@media (max-width: 640px) {
  .gold-card .gc-cols { grid-template-columns: 1fr; }
  table.gc-scarce { font-size: 13px; }
  table.gc-scarce th, table.gc-scarce td { padding: 5px 7px; }
  table.gc-scarce .item { white-space: normal; min-width: 150px; }
  table.gc-scarce .gc-do { display: none; }           /* what Danh does goes under the name: the table fits the phone */
  table.gc-scarce .gc-do-m { display: block; font-size: 12px; font-weight: 400; color: var(--muted); }
  .gold-card .gc-fig { white-space: normal; }
}
