/* 0.17 grid inventories (inv.js): Minecraft-style slots, page turns, and panels that fit their content. */
#drawer {
  bottom: auto;
  max-height: calc(var(--game-height, 100vh) - 104px);
}
.landscape-play #drawer {
  bottom: auto;
  max-height: calc(var(--game-height, 100vh) - 66px);
}
.inv-box {
  margin: 0 0 12px;
}
.inv-box > header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin: 0 2px 6px;
  font-size: 13px;
  color: #cfe0d8;
  letter-spacing: 0.06em;
}
.inv-box > header span {
  font-size: 12px;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}
.inv-grid {
  --slot: 52px;
  display: grid;
  grid-template-columns: repeat(var(--cols), var(--slot));
  gap: 4px;
  justify-content: center;
  width: max-content;
  max-width: 100%;
  margin: 0 auto;
  padding: 6px;
  border-radius: 6px;
  background: #0a1c22;
  box-shadow:
    inset 2px 2px 0 #050f12,
    inset -2px -2px 0 #1d3b44;
  perspective: 700px;
}
.inv-slot {
  position: relative;
  width: var(--slot);
  height: var(--slot);
  min-height: 0;
  padding: 7px;
  border: 0;
  border-radius: 3px;
  background: #1b3138;
  box-shadow:
    inset 2px 2px 0 #0a171b,
    inset -2px -2px 0 #2f5560;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition:
    background 0.12s,
    transform 0.08s;
}
.inv-slot svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(1px 1px 0 #0008);
}
.inv-slot b {
  position: absolute;
  right: 4px;
  bottom: 2px;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  text-shadow:
    1px 1px 0 #000,
    -1px 0 0 #0008;
  font-variant-numeric: tabular-nums;
}
.inv-slot:hover:not(:disabled),
.inv-slot:focus-visible {
  background: #2a4a54;
}
.inv-slot:active:not(:disabled) {
  transform: scale(0.94);
}
.inv-slot.zero svg {
  opacity: 0.28;
  filter: grayscale(1);
}
.inv-slot.zero b {
  color: #9fb7b3;
}
.inv-slot.empty {
  cursor: default;
}
.inv-slot:disabled {
  opacity: 0.4;
  cursor: default;
}
/* page turn: the new page swings in from the side it was turned toward */
.inv-grid.turn-next {
  animation: page-next 0.32s ease-out;
  transform-origin: left center;
}
.inv-grid.turn-prev {
  animation: page-prev 0.32s ease-out;
  transform-origin: right center;
}
@keyframes page-next {
  from {
    transform: rotateY(-70deg);
    opacity: 0.2;
  }
}
@keyframes page-prev {
  from {
    transform: rotateY(70deg);
    opacity: 0.2;
  }
}
.inv-pager {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  margin: 6px 0 0;
  font-size: 13px;
  color: #cfe0d8;
}
.inv-pager button {
  min-height: 30px;
  width: 38px;
  padding: 0;
  font-size: 18px;
}
.inv-amount {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 2px 0 12px;
  font-size: 12px;
  color: #9fb7b3;
}
.inv-amount button {
  min-height: 28px;
  padding: 2px 12px;
  font-size: 12px;
  border-radius: 999px;
}
.inv-amount button.active {
  border-color: var(--mint);
  color: var(--mint);
  background: #2c564966;
}
.inv-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin: 4px 0 6px;
}
.inv-actions button {
  min-height: 32px;
  font-size: 13px;
}
.inv-hint {
  margin: 4px 0 8px;
  text-align: center;
  font-size: 12px !important;
  line-height: 1.6 !important;
  color: #9fb7b3;
}
.bx-grid.lounge {
  grid-template-columns: repeat(6, 1fr);
}
.bx-grid.lounge .bx-cell:disabled {
  opacity: 0.55;
}
/* phones in landscape and the handheld device: smaller slots, same nine columns */
.landscape-play .inv-grid,
#drawer.device .inv-grid {
  --slot: 36px;
  gap: 3px;
  padding: 4px;
}
.landscape-play .inv-slot,
#drawer.device .inv-slot {
  padding: 4px;
}
.landscape-play .inv-slot b,
#drawer.device .inv-slot b {
  font-size: 11px;
  right: 2px;
  bottom: 0;
}
.landscape-play .bx-grid.lounge,
#drawer.device .bx-grid.lounge {
  grid-template-columns: repeat(3, 1fr);
}
@media (max-width: 520px) {
  .inv-grid {
    --slot: calc((100vw - 120px) / 9);
  }
}
/* 御獸遠航: partner tiles with a bond bar; the selected partner's orders sit below the grid */
.pet-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  perspective: 700px;
}
.pet-grid.turn-next {
  animation: page-next 0.32s ease-out;
  transform-origin: left center;
}
.pet-grid.turn-prev {
  animation: page-prev 0.32s ease-out;
  transform-origin: right center;
}
.pet-tile {
  position: relative;
  min-height: 58px;
  padding: 8px 10px 12px;
  border-radius: 4px;
  text-align: left;
  background: #1b3138;
  box-shadow:
    inset 2px 2px 0 #0a171b,
    inset -2px -2px 0 #2f5560;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.pet-tile b {
  font-size: 13px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.pet-tile small {
  font-size: 11px;
  color: #9fb7b3;
}
.pet-tile i {
  position: absolute;
  left: 8px;
  bottom: 5px;
  height: 3px;
  max-width: calc(100% - 16px);
  border-radius: 3px;
  background: linear-gradient(90deg, #84cabb, #e9cd91);
}
.pet-tile em {
  position: absolute;
  top: 6px;
  right: 8px;
  font-size: 10px;
  font-style: normal;
  color: var(--gold);
}
.pet-tile.active {
  outline: 2px solid var(--mint);
  background: #24434b;
}
.pet-tile.empty {
  min-height: 58px;
  border-radius: 4px;
  background: #0f2329;
}
.pet-orders {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
}
.pet-orders span {
  font-size: 13px;
  color: var(--gold);
  margin-right: 4px;
}
.pet-orders button {
  min-height: 32px;
  padding: 4px 12px;
  font-size: 13px;
}
/* 0.18: beast jobs, collection rewards */
.job-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  margin: 8px 0;
}
.job-row span {
  font-size: 12px;
  color: var(--gold);
  margin-right: 4px;
}
.job-row button {
  min-height: 28px;
  padding: 2px 9px;
  font-size: 12px;
  border-radius: 999px;
}
.job-row button.active {
  border-color: var(--mint);
  color: var(--mint);
  background: #2c564966;
}
.bx-cell {
  position: relative;
}
.job-badge {
  position: absolute;
  top: 4px;
  right: 6px;
  font-style: normal;
  font-size: 15px;
  filter: drop-shadow(0 1px 1px #000a);
}
.reward-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}
.reward-tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  min-height: 92px;
  padding: 9px 10px;
  border-radius: 4px;
  text-align: left;
  background: #1b3138;
  box-shadow:
    inset 2px 2px 0 #0a171b,
    inset -2px -2px 0 #2f5560;
}
.reward-tile b {
  font-size: 13px;
}
.reward-tile small,
.reward-tile em {
  font-size: 11px;
  font-style: normal;
  color: #9fb7b3;
  line-height: 1.4;
}
.reward-tile em {
  color: #c9e9dd;
}
.reward-tile span {
  margin-top: auto;
  font-size: 11px;
  color: var(--gold);
}
.reward-tile.ready {
  outline: 2px solid var(--gold);
  animation: reward-pulse 1.8s ease-in-out infinite;
}
.reward-tile.claimed {
  opacity: 0.7;
}
.reward-tile:disabled {
  cursor: default;
}
@keyframes reward-pulse {
  50% {
    box-shadow:
      inset 2px 2px 0 #0a171b,
      inset -2px -2px 0 #2f5560,
      0 0 14px #ecc78e66;
  }
}
.landscape-play .reward-grid,
#drawer.device .reward-grid {
  grid-template-columns: repeat(2, 1fr);
}
.landscape-play .reward-tile,
#drawer.device .reward-tile {
  min-height: 70px;
}

/* 0.20: the cabin furniture catalogue */
.decor-grid .reward-tile .ico {
  font-size: 20px;
  margin-right: 2px;
}
.decor-grid .reward-tile small {
  color: #8aa39f;
}

/* 0.22: BS gene chips */
.gene-chips.bs .bs-chip {
  background: #2a2140;
  color: #d9c9ff;
  border: 1px solid #5a4a8a;
}
.gene-chips.bs .bs-none {
  color: #7f8f8c;
  font-size: 11px;
}
.gene-grid .reward-tile small {
  color: #9fb7b3;
}

/* 0.23: skills and the base rating */
.skill-list {
  display: grid;
  gap: 8px;
}
.skill-row {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 4px;
  background: #1b3138;
  box-shadow:
    inset 2px 2px 0 #0a171b,
    inset -2px -2px 0 #2f5560;
}
.skill-row .ico {
  font-size: 20px;
  text-align: center;
}
.skill-row b em {
  font-style: normal;
  color: var(--gold);
  margin-left: 4px;
}
.skill-row small {
  display: block;
  color: #9fb7b3;
  font-size: 11px;
}
.skill-row i {
  display: block;
  height: 6px;
  margin-top: 5px;
  background: #0a171b;
  border-radius: 3px;
  overflow: hidden;
}
.skill-row i span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #5fe2bd, #ecc78e);
  transform-origin: left;
}
.skill-row .xp {
  color: #c9e9dd;
}
.base-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 8px;
}
.base-head b {
  font-size: 18px;
}
.base-head span {
  color: var(--gold);
  letter-spacing: 2px;
}
.base-head small {
  color: #9fb7b3;
}
.gear-chip {
  opacity: 0.55;
}
.gear-chip.owned {
  opacity: 1;
  border-color: var(--gold);
}

/* 0.25: contracts, the team, creature vs beast, throwing things away */
.bx-head {
  margin: 0 0 8px;
  font-size: 12px;
  color: #bcd0c6;
}
.bx-head b {
  color: #ffe4b0;
}
.kind-badge {
  position: absolute;
  top: 4px;
  left: 6px;
  font-style: normal;
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 6px;
  background: #0b2b30cc;
  color: #a9c9bd;
}
.bx-cell.is-beast .kind-badge {
  background: #3d2d10dd;
  color: #ffd38c;
  border: 1px solid #ffd38c66;
}
.bx-cell.is-beast {
  border-color: #ffd38c55;
}
.gene-chips.skills .sk-chip {
  background: #3a2a14;
  color: #ffe0a8;
  border: 1px solid #8a6a3a;
}
.gene-chips.skills .lv-chip {
  color: #cfe3da;
  font-size: 11px;
}
.inv-actions {
  display: flex;
  justify-content: flex-end;
  margin: 6px 0;
}
.inv-actions button.active {
  border-color: #ff7a6a;
  color: #ffb3a8;
  background: #4a1a1a88;
}
button.danger {
  border-color: #c96a5a99;
  color: #ffb8a8;
}

/* 0.29: personality, the skill tree */
.bx-persona {
  margin: 6px 0;
  font-size: 12px;
  color: #cfe3da;
}
.bx-persona b {
  color: #ffe4b0;
}
.bx-persona small {
  display: block;
  color: #9fbab7;
  font-size: 11px;
}
.tree-head {
  margin: 4px 0 10px;
  font-size: 13px;
}
.tree-head .pts {
  color: #ffd56a;
}
.tree-head small {
  display: block;
  color: #9fbab7;
  font-size: 11px;
}
.tree-cols {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.tree-col h4 {
  margin: 0 0 6px;
  font-size: 14px;
  color: #ffe4b0;
}
.tree-node {
  display: block;
  width: 100%;
  margin: 0 0 6px;
  padding: 8px 10px;
  border-radius: 8px;
  text-align: left;
  position: relative;
}
.tree-node b {
  display: block;
  font-size: 13px;
}
.tree-node small {
  display: block;
  font-size: 11px;
  color: #a9c4c1;
  margin-top: 2px;
}
.tree-node.have {
  border-color: #ffd38c99;
  background: #3a2a1499;
  opacity: 1;
}
.tree-node.next:not(:disabled) {
  border-color: #9ce8d1;
  box-shadow: 0 0 10px #9ce8d155;
}
.tree-node.locked {
  opacity: 0.45;
}
.tree-node:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 18px;
  bottom: -7px;
  width: 2px;
  height: 6px;
  background: #d3f4eb33;
}
#skill-3 {
  border-color: #ffd38c88;
  color: #ffe4b0;
}
#skill-3:disabled {
  opacity: 0.55;
}
@media (max-width: 760px), (max-height: 560px) {
  .tree-cols {
    gap: 6px;
  }
  .tree-node {
    padding: 6px 7px;
  }
  .tree-node small {
    font-size: 10px;
  }
}
