/* Hit Point & Click: party loot page (js/loot.js). Uses the tokens from app.css. */
.loot { margin-top: 10px; }
.loot-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.lt-who { margin: 4px 0 0; }
.lt-who b { color: var(--gold2); }
.lt-who .linkish { font-size: inherit; }
.loot .err { margin: 0 0 12px; }
.loot-grid { display: grid; grid-template-columns: minmax(300px, 380px) minmax(0, 1fr); gap: 18px; align-items: start; }
.loot .panel + .panel { margin-top: 0; }
.loot-log { margin-top: 18px; }

/* ---------- coins ---------- */
.coins { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.coin { display: flex; flex-direction: column; align-items: center; padding: 10px 4px 8px; border-radius: 12px; background: var(--bg2);
  border: 1px solid var(--line); min-width: 0; }
.coin b { font-family: var(--serif); font-size: 22px; line-height: 1.1; max-width: 100%; overflow-wrap: anywhere; text-align: center; }
.coin span { font-weight: 700; text-transform: uppercase; font-size: 12px; letter-spacing: .08em; }
.coin i { font-style: normal; font-size: 11px; color: var(--faint); }
.coin-pp b, .coin-pp span { color: #dfe6ee; }
.coin-gp b, .coin-gp span { color: var(--gold2); }
.coin-sp b, .coin-sp span { color: #c9c4bd; }
.coin-cp b, .coin-cp span { color: #e09a6a; }
.coin-total { grid-column: 1 / -1; text-align: center; color: var(--muted); font-size: 14px; margin-top: 2px; }
.coin-total b { color: var(--gold2); }
.coin-form { display: grid; grid-template-columns: 1fr 86px; gap: 8px; margin-top: 14px; }
.coin-form input { min-width: 0; width: 100%; }
.coin-form input[name=amt] { font-size: 18px; font-weight: 600; }
.coin-form input[name=note] { grid-column: 1 / -1; }
.coin-btns { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.coin-btns .btn { padding: 9px 10px; font-size: 14px; }

.loot-sub { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px; }
.loot-sub summary { cursor: pointer; color: var(--muted); font-size: 14px; }
.loot-sub summary:hover { color: var(--gold); }
.loot-sub[open] summary { color: var(--gold); margin-bottom: 10px; }
.loot .check { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; }
.split-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.split-row > label:first-child { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.split-row input[type=number] { width: 70px; }
.split-out { margin-top: 10px; display: grid; gap: 6px; }
.split-line { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; font-size: 14px; }
.split-line > span:first-child { color: var(--muted); }
.split-line b { color: var(--gold2); }
.fix-form { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; align-items: end; }
.fix-form label { display: grid; gap: 3px; color: var(--muted); font-size: 12px; text-transform: uppercase; }
.fix-form input { width: 100%; min-width: 0; }
.fix-form .btn { grid-column: 1 / -1; justify-self: start; }
.loot-sub .fine { margin: 0 0 10px; }

/* ---------- items ---------- */
.items-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.items-top h2 { margin-bottom: 0; }
.items-top h2 { margin-right: auto; }
.lt-total { white-space: nowrap; }                  /* same font as the heading, so it follows the theme */
.lt-total b { color: var(--gold2); font-weight: inherit; }
.items-top input[type=search] { background: var(--bg2); border: 1px solid var(--line2); border-radius: 8px; padding: 7px 10px; width: 220px; max-width: 100%; }
.add-item { display: grid; grid-template-columns: minmax(160px, 2.2fr) 64px 1fr 1fr 1.3fr auto; gap: 8px; align-items: end;
  padding: 12px; border-radius: 12px; background: var(--bg2); border: 1px dashed var(--line2); margin-bottom: 14px; }
.add-item label { display: grid; gap: 3px; color: var(--muted); font-size: 12px; min-width: 0; }
.add-item input { width: 100%; min-width: 0; background: var(--bg); }
.add-item .btn { white-space: nowrap; padding: 8px 12px; }

.item { display: grid; grid-template-columns: minmax(0, 2.2fr) 132px minmax(0, .9fr) minmax(0, .9fr) minmax(0, 1.2fr) 80px; gap: 8px;
  align-items: center; padding: 6px 4px; border-bottom: 1px solid var(--line); }
.item.head { color: var(--faint); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; padding-top: 0; }
.item:not(.head):hover { background: rgba(255, 255, 255, .02); }
.item .lbl { display: none; }
.lt-cell { display: block; width: 100%; min-width: 0; text-align: left; background: none; border: 1px solid transparent; border-radius: 6px;
  padding: 4px 6px; cursor: text; overflow-wrap: anywhere; }
.lt-cell:hover { border-color: var(--line2); background: var(--bg2); }
.lt-cell:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }
.lt-cell.nm { font-weight: 600; color: var(--text); }
.lt-cell.notes { font-size: 13px; color: var(--muted); padding-top: 0; }
.lt-cell .ph { color: var(--faint); font-style: italic; }
.lt-cell.notes .ph { opacity: 0; }
.item:hover .lt-cell.notes .ph, .lt-cell.notes:focus .ph { opacity: 1; }
.lt-edit { width: 100%; min-width: 0; background: var(--bg2); border: 1px solid var(--gold-dim); border-radius: 6px; padding: 4px 6px; font-size: 14px; }
textarea.lt-edit { resize: vertical; }
.c-qty { display: flex; align-items: center; gap: 4px; }
.c-qty .lt-cell { text-align: center; font-weight: 600; flex: 1; padding: 4px 2px; }
.c-qty .lt-edit { flex: 1; text-align: center; }
.btn.step { width: 30px; height: 30px; padding: 0; font-size: 16px; flex: none; }
.btn.step:disabled { opacity: .35; cursor: default; }
.c-del { display: flex; justify-content: flex-end; gap: 4px; }
.btn.del, .btn.act { padding: 4px 9px; }
.btn.act { font-weight: 700; letter-spacing: .05em; }
.lt-undo { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px; margin-bottom: 10px; border-radius: 10px;
  background: var(--panel2); border: 1px solid var(--gold-dim); color: var(--text); font-size: 14px; }
.lt-carry { flex-basis: 100%; display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 4px 16px; font-size: 13px; }
.lt-carry .extras-h { align-self: center; }
.sellset { display: flex; gap: 8px; }
.selltotal { margin: 0; color: var(--muted); }
.selltotal b { color: var(--gold2); }
.items .none { padding: 24px; text-align: center; color: var(--muted); border: 1px dashed var(--line2); border-radius: 12px; }
.items-totals { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 6px 22px; margin-top: 12px; color: var(--muted); font-size: 14px; }
.items-totals b { color: var(--gold2); }

/* ---------- activity ---------- */
.loot-log > summary { display: flex; align-items: baseline; gap: 14px; cursor: pointer; list-style: none; flex-wrap: wrap; }
.loot-log > summary::-webkit-details-marker { display: none; }
.loot-log > summary h2 { margin-bottom: 0; }
.loot-log > summary h2::before { content: '▸'; display: inline-block; width: 1.1em; color: var(--faint); }
.loot-log[open] > summary h2::before { content: '▾'; }
.loot-log > summary .fine { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.loot-log[open] > summary .fine { display: none; }
.loot-log ol { list-style: none; margin: 12px 0 0; padding: 0; max-height: 420px; overflow-y: auto; }
.loot-log li { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.loot-log li span { min-width: 0; overflow-wrap: anywhere; }
.loot-log time { flex: none; color: var(--faint); font-size: 12px; white-space: nowrap; }

@media (max-width: 1000px) {
  .loot-grid { grid-template-columns: minmax(0, 1fr); }
  .add-item { grid-template-columns: 1fr 1fr 1fr; }
  .add-item > input[name=name] { grid-column: 1 / -1; }
  .add-item label:nth-of-type(4) { grid-column: 1 / 3; }
}
@media (max-width: 700px) {
  .item.head { display: none; }
  .item { grid-template-columns: 1fr 1fr; gap: 6px 10px; padding: 10px; margin-bottom: 10px; border: 1px solid var(--line); border-radius: 12px;
    background: var(--bg2); position: relative; }
  .item .c-name { grid-column: 1 / -1; padding-right: 80px; }
  .item .c-del { position: absolute; top: 10px; right: 10px; }
  .item .lbl { display: block; font-size: 11px; color: var(--faint); text-transform: uppercase; letter-spacing: .06em; padding-left: 6px; }
  .item .c-qty { flex-wrap: wrap; }
  .item .c-qty .lbl { flex-basis: 100%; }
  .lt-cell.nm { font-size: 16px; }
  .lt-cell.notes .ph { opacity: 1; }
  .items-totals, .lt-carry { justify-content: flex-start; }
  .lt-edit, .add-item input, .coin-form input, .fix-form input { font-size: 16px; }
}
@media (max-width: 420px) {
    .coin b { font-size: 18px; }
  .add-item label:nth-of-type(4) { grid-column: 1 / -1; }
  .add-item .btn { grid-column: 1 / -1; }
  .items-top input[type=search] { width: 100%; }
}
