/* The character builder (tools/wiki/builder.js): the character window, the equipment window and the sheet drawn as game windows (picker.css's black
   stone panel look: our own CSS, no game art), the gear list and the skills table. */
.cb { margin: 6px 0 20px; }
.cb .pk { margin: 0; }
.cb-top { display: grid; grid-template-columns: minmax(300px, 1.05fr) minmax(260px, 0.8fr) minmax(280px, 1fr); gap: 14px; align-items: start; }
.cb-win { min-width: 0; }
.cb-pick, .cb-skills { margin-top: 14px; }
.cb-note { margin: 8px 0 0; font: 12px/1.45 Tahoma, "Segoe UI", Arial, sans-serif; color: #a9a49d; }
.cb-points { margin: 10px 0 0; font: 700 13px Tahoma, "Segoe UI", Arial, sans-serif; color: #7fe08a; }
.cb-red, .cb-points.cb-red { color: #ff5a4a; }
.cb-err { color: #ff8a7a; font: 13px/1.5 Tahoma, "Segoe UI", Arial, sans-serif; }
.cb .hint { color: #a9a49d; font: 13px/1.5 Tahoma, "Segoe UI", Arial, sans-serif; margin: 4px 0; }

/* the number boxes and the stat rows */
.cb-num, .cb-search, .cb-select { font: 13px Tahoma, "Segoe UI", Arial, sans-serif; color: #f2f2f2; background: #0a0a0a; border: 1px solid #8b8885; border-radius: 4px; box-shadow: inset 0 1px 3px rgba(0,0,0,.8); padding: 5px 7px; min-height: 32px; }
.cb-num { width: 72px; text-align: right; }
.cb-search { width: 100%; }
.cb-select { max-width: 100%; }
.cb-num:focus-visible, .cb-search:focus-visible, .cb-select:focus-visible { outline: 2px solid #f0b030; outline-offset: 1px; }
.cb-stats { display: grid; gap: 6px; margin-top: 8px; padding: 8px; border: 1px solid #6d6b69; border-radius: 4px; background: rgba(0,0,0,.45); box-shadow: inset 0 0 0 1px #000; }
.cb-stat { display: grid; grid-template-columns: 78px 32px 72px 32px minmax(0, 1fr) auto; align-items: center; gap: 6px; }
.cb-sl { color: #e8a33a; font: 700 12px Tahoma, "Segoe UI", Arial, sans-serif; }
.cb-pm { min-width: 32px; min-height: 32px; padding: 0; font-size: 16px; }
.cb-rest { min-height: 32px; }
.cb-st { color: #fff; font: 700 13px Tahoma, "Segoe UI", Arial, sans-serif; text-align: right; }
.cb-add { color: #7fe08a; font-weight: 400; }

/* the equipment window: the slots as the game lays them out */
.cb-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; max-width: 330px; margin: 6px auto 0; }
.cb-slot { position: relative; aspect-ratio: 1; min-height: 70px; padding: 4px; display: grid; place-items: center; cursor: pointer; font: 11px/1.2 Tahoma, "Segoe UI", Arial, sans-serif; color: #8d8984;
  background: radial-gradient(circle at 50% 35%, #26231f, #0c0b0a 75%); border: 1px solid #77736e; border-radius: 4px; box-shadow: inset 0 0 0 1px #000, inset 0 0 10px rgba(0,0,0,.8);
  -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }
.cb-slot:hover { border-color: #c9c5c0; background: radial-gradient(circle at 50% 35%, #34302a, #12100e 75%); }
.cb-slot.open { border-color: #f0b030; box-shadow: inset 0 0 0 1px #000, 0 0 0 1px #f0b030, 0 0 8px rgba(240,176,48,.5); }
.cb-slot.has { border-color: var(--nc, #aaa); }
.cb-slot.bad { border-color: #ff3b30; box-shadow: inset 0 0 0 1px #000, inset 0 0 12px rgba(255,59,48,.55); }
.cb-slot:focus-visible { outline: 2px solid #f0b030; outline-offset: 2px; }
.cb-slot img { position: absolute; left: 6px; top: 6px; width: calc(100% - 12px); height: calc(100% - 12px); max-width: none; object-fit: contain; }
.cb-sn { text-align: center; text-wrap: balance; padding: 0 2px; }
.cb-slot.k-wings img { filter: brightness(1.9) contrast(1.05); }
.cb-lv { position: absolute; right: 3px; bottom: 2px; font: 700 11px Tahoma, Arial, sans-serif; color: #ffd27a; text-shadow: 0 0 3px #000, 0 0 3px #000; }

/* the sheet */
.cb-group { margin-top: 8px; padding: 6px 8px 8px; border: 1px solid #6d6b69; border-radius: 4px; background: rgba(0,0,0,.45); box-shadow: inset 0 0 0 1px #000; }
.cb-group:first-child { margin-top: 0; }
.cb-gt { color: #e8a33a; font: 700 12px/1.6 Tahoma, "Segoe UI", Arial, sans-serif; }
.cb-line { display: flex; justify-content: space-between; gap: 12px; font: 13px/1.7 Tahoma, "Segoe UI", Arial, sans-serif; color: #ddd; border-bottom: 1px solid rgba(255,255,255,.06); }
.cb-line:last-child { border-bottom: 0; }
.cb-v { color: #fff; font-weight: 700; text-align: right; }
.cb-bonus { font: 12.5px/1.5 Tahoma, "Segoe UI", Arial, sans-serif; color: #7fb3ff; padding: 2px 0; }
.cb-bonus b { color: #cfd8ee; }
.cb-bonus.cb-red { color: #ff7a6a; }
.cb-bonus.cb-red b { color: #ffb0a6; }

/* the skills */
.cb-tg { display: inline-flex; align-items: center; gap: 6px; font: 12px Tahoma, "Segoe UI", Arial, sans-serif; color: #e8a33a; }
.cb-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.cb-table { width: 100%; border-collapse: collapse; font: 13px/1.4 Tahoma, "Segoe UI", Arial, sans-serif; color: #ddd; background: transparent; border: 0; }
.cb-table th { color: #e8a33a; font-weight: 700; text-align: right; padding: 6px 10px; border-bottom: 1px solid #6d6b69; background: transparent; white-space: nowrap; }
.cb-table th:first-child, .cb-table td:first-child { text-align: left; }
.cb-table td { text-align: right; padding: 5px 10px; border-bottom: 1px solid rgba(255,255,255,.07); background: transparent; color: #f2f2f2; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cb-table tr.cb-unmet td { color: #ff7a6a; }
.cb-table tr:hover td { background: rgba(255,255,255,.04); }
.cb-sname { font-weight: 700; }

/* the gear list and the controls */
.cb-pick-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 16px; align-items: start; }
.cb-filters { display: grid; gap: 7px; margin-bottom: 8px; }
.cb-list { max-height: 420px; overflow-y: auto; border: 1px solid #6d6b69; border-radius: 4px; background: rgba(0,0,0,.45); box-shadow: inset 0 0 0 1px #000; -webkit-overflow-scrolling: touch; }
.cb-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 5px 10px; text-align: left; cursor: pointer; font: 13px/1.3 Tahoma, "Segoe UI", Arial, sans-serif; color: #ddd;
  background: none; border: 0; border-bottom: 1px solid rgba(255,255,255,.07); -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; min-height: 46px; }
.cb-item:hover { background: rgba(255,255,255,.07); }
.cb-item.on { background: linear-gradient(#4a3a1a, #2a1d08); color: #ffd27a; }
.cb-item:focus-visible { outline: 2px solid #f0b030; outline-offset: -2px; }
.cb-item img { width: 34px; height: 34px; max-width: none; object-fit: contain; flex: none; }
.cb-it { display: grid; min-width: 0; }
.cb-in { font-weight: 700; color: #fff; overflow-wrap: anywhere; }
.cb-ir { color: #a9a49d; font-size: 11.5px; }
.cb-ir .cb-red { color: #ff6a5a; }
.cb-detail { display: grid; gap: 12px; min-width: 0; }
.cb-ctl { display: grid; gap: 7px; }
.cb-detail .pk-out { position: static; }
.cb-page { font: 12.5px Tahoma, "Segoe UI", Arial, sans-serif; color: #e8a33a; }
.cb-page:hover { color: #ffd27a; }
.cb-tip { position: absolute; z-index: 30; width: 300px; pointer-events: none; }
.cb-tip[hidden] { display: none; }

@media (max-width: 1100px) {
  .cb-top { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .cb-sheet { grid-column: 1 / -1; }
}
@media (max-width: 720px) {
  .cb-top, .cb-pick-body { grid-template-columns: minmax(0, 1fr); }
  .cb-stat { grid-template-columns: 70px 36px 64px 36px minmax(0, 1fr) auto; gap: 4px; }
  .cb-pm { min-width: 36px; min-height: 38px; }
  .cb-num { min-height: 38px; }
  .cb-grid { max-width: 100%; }
  .cb-list { max-height: 340px; }
  .cb-item { min-height: 52px; }
  .cb-tip { display: none; }
}
.cb-skills .pk-head { flex-wrap: wrap; }
