/* ---------- Inventory ---------- */
#invpanel {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(1080px, 96vw);
  max-height: 92vh;
  overflow-y: auto;
  background: linear-gradient(#171310, #0c0a07);
  border: 2px solid #000;
  outline: 2px double #4a3b26;
  padding: 16px 18px;
  z-index: 30;
  display: none;
  pointer-events: auto;
  box-shadow: 0 0 60px #000;
}

#invpanel h2 {
  margin: 0 0 10px;
  font-size: 1rem;
  letter-spacing: 5px;
  text-transform: uppercase;
  font-weight: normal;
  color: #e0d0b2;
  border-bottom: 1px solid #33291c;
  padding-bottom: 8px;
}

#invcols {
  display: flex;
  gap: 16px;
  align-items: stretch;
}

.icol {
  flex: 0 0 auto;
  min-width: 0;
}

#colinv {
  flex: 0 0 auto;
}

#colact {
  flex: 0 0 310px;
  border-left: 1px solid #2a2218;
  border-right: 1px solid #2a2218;
  padding: 0 14px;
}

#colctx {
  flex: 1 1 240px;
  min-width: 220px;
}

.colh {
  font-size: 0.6875rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: #6d6047;
  margin-bottom: 10px;
  border-bottom: 1px solid #241d14;
  padding-bottom: 5px;
}

.rowsep {
  font-size: 0.625rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #5c5342;
  margin: 12px 0 6px;
}

#invflex {
  display: flex;
  gap: 14px;
}

#eqcol {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.eqslot {
  width: 58px;
  height: 58px;
  background: #0d0a07;
  border: 1px solid #000;
  outline: 1px solid #3a2f22;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.625rem;
  position: relative;
  cursor: pointer;
}

.eqslot .lab {
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 0.5rem;
  letter-spacing: 1px;
  color: #5f564a;
  text-transform: uppercase;
}

#statcol {
  font-size: 0.78125rem;
  line-height: 1.75;
  color: var(--bone-dim);
  min-width: 150px;
}

#statcol b {
  color: var(--bone);
  font-weight: normal;
}

#invgrid {
  display: grid;
  grid-template-columns: repeat(6, 46px);
  gap: 5px;
  align-content: start;
}

.cell {
  width: 46px;
  height: 46px;
  background: #0d0a07;
  border: 1px solid #000;
  outline: 1px solid #26201660;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3125rem;
  cursor: pointer;
  position: relative;
}

.cell.slotlock {
  background: #080605;
  cursor: default;
  outline-color: #1c171060;
}

#sortbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}

#sortlist {
  margin-top: 5px;
}

.srow {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 9px;
  margin-top: 4px;
  font-size: 0.75rem;
  background: #12100c;
  border: 1px solid #000;
  outline: 1px solid #26201660;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.srow.drag {
  outline-color: #d8a53f;
  background: #1a1610;
}

.srow .rank {
  color: #d8a53f;
  width: 12px;
}

.srow .grip {
  margin-left: auto;
  color: #4f4737;
  letter-spacing: 2px;
}

.slotlockg {
  font-size: 0.8125rem;
  opacity: .35;
  filter: grayscale(1);
}

.lockmark {
  position: absolute;
  top: 0;
  right: 1px;
  font-size: 0.625rem;
  line-height: 1;
  color: #d8a53f;
  text-shadow: 0 0 3px #000, 0 0 3px #000;
  pointer-events: none;
}

.cell.prot,
.eqslot.prot {
  outline-color: #6b5626;
}

.cell:hover {
  background: #171310;
}

#actbar {
  margin-top: 12px;
}

#selinfo {
  min-height: 20px;
  margin-bottom: 6px;
}

#rowgamble,
#rowbulk {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

#rowgamble .btn,
#rowbulk .btn,
#ctxmenu .btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  height: 32px;
  padding: 0 10px;
  font-size: 0.71875rem;
  letter-spacing: 1px;
  text-align: left;
  box-sizing: border-box;
  line-height: 1;
}

#lockline {
  margin-top: 8px;
  font-size: 0.71875rem;
}

#gamblecost,
#slotcost {
  margin: 6px 0 2px;
  font-size: 0.71875rem;
}

#rowslots {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

#rowslots .btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

#ctxmenu .cminfo {
  padding: 2px 4px 8px;
  border-bottom: 1px solid #241d14;
  margin-bottom: 7px;
  font-size: 0.75rem;
  line-height: 1.55;
}

#ctxmenu .cminfo .nm {
  font-size: 0.8125rem;
  letter-spacing: 1px;
  margin-bottom: 3px;
}

#ctxmenu .cminfo .tp {
  color: #6d6047;
  font-size: 0.65625rem;
  margin-bottom: 5px;
}

#ctxmenu .cminfo .af {
  color: #9fd8cc;
}

.btn .lbl {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#selinfo {
  min-height: 34px;
  margin-bottom: 10px;
  font-size: 0.75rem;
  line-height: 1.5;
}

#actmsg {
  min-height: 34px;
  font-size: 0.75rem;
  color: #d8a53f;
  font-style: italic;
  line-height: 1.45;
  margin-bottom: 8px;
}

#ctxcraft {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
}

#ctxcraft .btn {
  text-align: left;
}

#ctxcraft:empty {
  display: none;
}

#statcol.hid {
  display: none;
}

.btn.armed {
  border-color: #d8a53f;
  color: #d8a53f;
  box-shadow: 0 0 6px rgba(216, 165, 63, .35);
}

.btn.off {
  opacity: .35;
}

select.btn {
  background: #17120b;
}

.btn .cost {
  font-size: 0.65625rem;
  color: #8a7d63;
  white-space: nowrap;
  flex: 0 0 auto;
}

.btn.poor {
  opacity: .45;
}

.cell.graftable {
  outline: 2px dashed #b05bf0;
  outline-offset: -2px;
}

.pvh {
  color: #d8a53f;
  font-style: italic;
  margin-bottom: 6px;
}

#matline {
  font-size: 0.8125rem;
  color: #8a7d63;
}

#actbar .hintline {
  color: #5c5342;
  font-size: 0.75rem;
  font-style: italic;
}

.cell.sel,
.eqslot.sel {
  outline: 2px solid #d8a53f;
  outline-offset: -2px;
}

.btn.danger {
  border-color: #6b1420;
  color: #d13a4e;
}

#invfoot {
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-top: 1px solid #33291c;
  padding-top: 12px;
  flex-wrap: wrap;
}

.btn {
  font-family: inherit;
  background: linear-gradient(#241c12, #120d08);
  color: var(--bone);
  border: 1px solid #000;
  outline: 1px solid #5a4930;
  padding: 9px 22px;
  font-size: 0.875rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  cursor: pointer;
}

.btn:hover {
  color: #fff;
  outline-color: #8a7148;
  box-shadow: 0 0 14px rgba(216, 165, 63, .25);
}

.btn:active {
  transform: translateY(1px);
}

/* Matches the .off convention above. The hover and press feedback have to be
   cancelled too, or a button that cannot be pressed still answers the mouse. */
.btn:disabled {
  opacity: .35;
  cursor: default;
}
.btn:disabled:hover {
  color: var(--bone);
  outline-color: #5a4930;
  box-shadow: none;
}
.btn:disabled:active {
  transform: none;
}

#gamblecost {
  color: var(--gold);
  font-size: 0.75rem;
}

/* tooltip */
#confirmscr {
  z-index: 70;
}

#cfbox {
  width: min(460px, 92vw);
  background: linear-gradient(#171310, #0c0a07);
  border: 2px solid #000;
  outline: 2px double #6b1420;
  padding: 22px 24px;
  box-shadow: 0 0 80px #000;
}

#cfbox h1 {
  margin: 0 0 14px;
  font-size: 1.1875rem;
  letter-spacing: 6px;
  color: #d13a4e;
}

#cfcard {
  text-align: left;
  font-size: 0.78125rem;
  line-height: 1.6;
  border: 1px solid #241d14;
  background: rgba(0, 0, 0, .35);
  padding: 10px 12px;
  margin-bottom: 14px;
}

#cfcard .nm {
  font-size: 0.875rem;
  letter-spacing: 1px;
  margin-bottom: 3px;
}

#cfcard .tp {
  color: #6d6047;
  font-size: 0.65625rem;
  margin-bottom: 6px;
}

#cfcard .af {
  color: #9fd8cc;
}

#cfcard .hint {
  display: none;
}

#cfbody {
  font-size: 0.8125rem;
  line-height: 1.65;
  color: var(--bone-dim);
  margin-bottom: 18px;
}

#cfbody b {
  color: var(--bone);
  font-weight: normal;
}

#cfbtns {
  display: flex;
  gap: 12px;
  justify-content: center;
}

#cfbtns .btn {
  min-width: 130px;
  justify-content: center;
}

.cfkeys {
  margin-top: 14px;
  font-size: 0.6875rem;
  color: #4f4737;
  letter-spacing: 1px;
}

#ctxmenu {
  position: fixed;
  z-index: 40;
  display: none;
  min-width: 290px;
  max-width: 340px;
  max-height: 92vh;
  overflow-y: auto;
  padding: 7px;
  background: linear-gradient(#171310, #0c0a07);
  border: 1px solid #4a3b26;
  box-shadow: 0 0 30px #000;
  pointer-events: auto;
}

#ctxmenu .cmh {
  padding: 0;
}

#cmbody {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

#tooltip {
  position: fixed;
  z-index: 60;
  pointer-events: none;
  background: rgba(10, 8, 6, .96);
  border: 1px solid #000;
  outline: 1px solid #4a3b26;
  padding: 9px 12px;
  font-size: 0.78125rem;
  line-height: 1.6;
  max-width: 420px;
  min-width: 260px;
  display: none;
  box-shadow: 0 4px 24px #000;
}

#tooltip .nm {
  font-size: 0.875rem;
  letter-spacing: 1px;
}

#tooltip .tp {
  color: #5f564a;
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 4px;
}

#tooltip .af {
  color: #a8d0f5;
}

#tooltip .hint {
  color: #5f564a;
  font-size: 0.6875rem;
  margin-top: 5px;
  font-style: italic;
}

.sorter {
  margin-left: 74px;
}

#sortbtn {
  flex-grow: 1;
}
