/* This page is a data browser, not prose - let it use the full grid width
   instead of Material's narrow article column. */
.md-grid:has(.gamedb-root) {
  max-width: 100%;
}

.gamedb-root {
  --gamedb-bg: var(--md-primary-fg-color, #1b2433);
  --gamedb-bg-light: var(--md-primary-fg-color--light, #2c3a52);
  --gamedb-gold: var(--md-accent-fg-color, #d8a657);
  --gamedb-spawn: #4ee06a;
  display: flex;
  flex-direction: column;
  gap: .75rem;
  color: #e8ecf4;
  font-size: .78rem;
}

/* Compact entity preview shown by cross-links outside the database page. */
.gamedb-entity-preview {
  --gamedb-bg: var(--md-primary-fg-color, #1b2433);
  --gamedb-bg-light: var(--md-primary-fg-color--light, #2c3a52);
  --gamedb-gold: var(--md-accent-fg-color, #d8a657);
  position: fixed;
  z-index: 110;
  box-sizing: border-box;
  width: min(19rem, calc(100vw - 1rem));
  padding: .65rem;
  color: #e8ecf4;
  background: linear-gradient(180deg, #1b2433, #11161f);
  border: 1px solid var(--gamedb-gold);
  border-radius: .35rem;
  box-shadow: 0 0 0 1px rgba(216, 166, 87, .2), 0 .75rem 1.5rem rgba(0, 0, 0, .45);
  font-size: .7rem;
  line-height: 1.35;
  pointer-events: none;
  animation: gamedb-preview-in .12s ease-out;
}

.gamedb-entity-preview-header {
  display: flex;
  align-items: center;
  gap: .55rem;
}

.gamedb-entity-preview-header img {
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  object-fit: contain;
  border: 1px solid var(--gamedb-bg-light);
  border-radius: .2rem;
  background: #0d1119;
}

.gamedb-entity-preview-heading {
  min-width: 0;
}

.gamedb-entity-preview-title {
  color: var(--gamedb-gold);
  font-size: .78rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.gamedb-entity-preview-subtitle {
  margin-top: .1rem;
  opacity: .62;
  font-size: .6rem;
  overflow-wrap: anywhere;
}

.gamedb-entity-preview-fields {
  display: grid;
  gap: .15rem;
  margin-top: .5rem;
  padding-top: .45rem;
  border-top: 1px solid var(--gamedb-bg-light);
}

.gamedb-entity-preview-field {
  display: flex;
  justify-content: space-between;
  gap: .75rem;
}

.gamedb-entity-preview-field span {
  opacity: .62;
}

/* Entity cross-links inside guides get the same sprite as their database
   preview. Existing hand-authored images are left untouched by the script. */
.md-typeset img.gamedb-guide-link-sprite {
  display: inline-block;
  width: 1.35rem;
  height: 1.35rem;
  margin: 0 .22em 0 0;
  object-fit: contain;
  vertical-align: -.36rem;
  border-radius: .12rem;
}

.gamedb-entity-preview-field strong {
  color: inherit;
  font-weight: 600;
  text-align: right;
}

.gamedb-entity-preview-description {
  display: -webkit-box;
  margin-top: .45rem;
  padding-top: .4rem;
  border-top: 1px solid var(--gamedb-bg-light);
  opacity: .82;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

@keyframes gamedb-preview-in {
  from {
    opacity: 0;
    transform: translateY(3px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .gamedb-entity-preview {
    animation: none;
  }
}

.gamedb-loading {
  opacity: .7;
  font-style: italic;
}

.gamedb-toolbar {
  display: flex;
  gap: .5rem;
}

.gamedb-search {
  flex: 1;
  position: relative;
}

.gamedb-search input {
  width: 100%;
  box-sizing: border-box;
  padding: .5rem .75rem;
  border-radius: .25rem;
  border: 1px solid var(--gamedb-bg-light);
  background: var(--gamedb-bg);
  color: #e8ecf4;
  font-size: .85rem;
}

.gamedb-search input:focus {
  outline: none;
  border-color: var(--gamedb-gold);
}

.gamedb-search-results {
  position: absolute;
  z-index: 20;
  top: 100%;
  left: 0;
  right: 0;
  max-height: 22rem;
  overflow-y: auto;
  background: var(--gamedb-bg);
  border: 1px solid var(--gamedb-gold);
  border-radius: .25rem;
  margin-top: .25rem;
}

.gamedb-search-results:empty {
  display: none;
}

.gamedb-search-row {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .4rem .6rem;
  cursor: pointer;
  border-bottom: 1px solid var(--gamedb-bg-light);
}

.gamedb-search-row:last-child {
  border-bottom: none;
}

.gamedb-search-row:hover {
  background: var(--gamedb-bg-light);
}

.gamedb-search-row .gamedb-domain-tag {
  margin-left: auto;
}

.gamedb-layout {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.gamedb-tree {
  flex: 0 0 15rem;
  border: 1px solid var(--gamedb-bg-light);
  border-radius: .25rem;
  padding: .5rem;
  max-height: 70vh;
  overflow-y: auto;
}

.gamedb-tree-node > .gamedb-tree-label {
  display: flex;
  align-items: center;
  gap: .35rem;
  padding: .35rem .3rem;
  cursor: pointer;
  border-radius: .2rem;
}

.gamedb-tree-node > .gamedb-tree-label:hover {
  background: var(--gamedb-bg-light);
}

.gamedb-tree-node.active > .gamedb-tree-label {
  background: var(--gamedb-bg-light);
  color: var(--gamedb-gold);
  font-weight: 600;
}

.gamedb-tree-children {
  padding-left: 1rem;
  border-left: 1px dashed var(--gamedb-bg-light);
  margin-left: .6rem;
}

.gamedb-tree-icon {
  width: 20px;
  height: 20px;
  object-fit: contain;
  border-radius: .2rem;
  flex-shrink: 0;
}

.gamedb-tree-caret {
  display: inline-block;
  width: 1em;
  margin-left: auto;
  transition: transform .15s ease;
}

.gamedb-tree-node.expanded > .gamedb-tree-label .gamedb-tree-caret {
  transform: rotate(90deg);
}

.gamedb-main {
  flex: 1;
  min-width: 0;
}

.gamedb-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: .6rem;
}

.gamedb-filter-bar select,
.gamedb-filter-bar input {
  background: var(--gamedb-bg);
  color: #e8ecf4;
  border: 1px solid var(--gamedb-bg-light);
  border-radius: .3rem;
  padding: .3rem .5rem;
  font-size: .75rem;
}

.gamedb-filter-bar select option {
  background: #101a27;
  color: #e8ecf4;
}

.gamedb-count {
  opacity: .6;
  font-weight: 400;
  margin-left: .25rem;
}

.gamedb-grade-filter {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem;
}

.gamedb-grade-filter-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 1.9rem;
  height: 1.9rem;
  padding: 0 .5rem;
  background: var(--gamedb-bg);
  color: #e8ecf4;
  border: 1px solid var(--gamedb-bg-light);
  border-radius: .3rem;
  cursor: pointer;
  font-size: .72rem;
}

.gamedb-grade-filter-btn img {
  width: 1.1rem;
  height: 1.1rem;
}

.gamedb-grade-filter-btn:hover {
  border-color: var(--gamedb-gold);
}

.gamedb-grade-filter-btn.active {
  border-color: var(--gamedb-gold);
  background: var(--gamedb-bg-light);
  box-shadow: 0 0 0 1px var(--gamedb-gold);
}

.gamedb-mob-list {
  display: flex;
  flex-direction: column;
  gap: .3rem;
}

.gamedb-mob-list-header,
.gamedb-mob-row {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 4.5rem 3.6rem;
  align-items: center;
  gap: .6rem;
}

.gamedb-mob-list-header {
  padding: .15rem .6rem;
  color: #9ca5b5;
  font-size: .65rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.gamedb-dropped-mob-list-header,
.gamedb-dropped-mob-list .gamedb-dropped-mob-row {
  grid-template-columns: 48px minmax(0, 1fr) 4.5rem 5.25rem 3.6rem;
}

.gamedb-mob-list-header .gamedb-item-sort-cell:nth-child(n+3) .gamedb-item-sort {
  justify-content: flex-end;
  text-align: right;
}

.gamedb-mob-row {
  padding: .4rem .6rem;
  border: 1px solid var(--gamedb-bg-light);
  border-radius: .3rem;
  cursor: pointer;
  background: var(--gamedb-bg);
}

.gamedb-mob-row:hover {
  border-color: var(--gamedb-gold);
}

.gamedb-mob-row img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  flex-shrink: 0;
  background: radial-gradient(circle, rgba(255,255,255,.06) 0%, rgba(255,255,255,0) 70%);
  border-radius: .2rem;
}

.gamedb-mob-row-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gamedb-mob-row-level {
  opacity: .7;
  justify-self: end;
  text-align: right;
  white-space: nowrap;
}

.gamedb-mob-row-grade {
  width: 1.1rem;
  height: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  justify-self: end;
}

.gamedb-dropped-mobs {
  display: grid;
  gap: .5rem;
}

.gamedb-dropped-mob-search {
  margin: 0;
}

.gamedb-dropped-mob-count {
  color: #8d98a8;
  font-size: .7rem;
  text-align: right;
}

.gamedb-dropped-mob-chance {
  color: #d8b66a;
  font-size: .72rem;
  justify-self: end;
  text-align: right;
  white-space: nowrap;
}

.gamedb-item-list {
  display: flex;
  flex-direction: column;
  gap: .3rem;
}

.gamedb-item-list-header,
.gamedb-item-row {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 5.5rem 8rem;
  align-items: center;
  gap: .7rem;
}

.gamedb-compact-item-list-header,
.gamedb-compact-item-row {
  grid-template-columns: 48px minmax(0, 1fr) 5.5rem;
}

.gamedb-name-only-item-list-header,
.gamedb-name-only-item-row {
  grid-template-columns: 48px minmax(0, 1fr);
}

.gamedb-ammo-item-list-header,
.gamedb-ammo-item-row {
  grid-template-columns: 48px minmax(10rem, 1fr) minmax(7rem, 9rem);
}

.gamedb-coupon-item-list-header,
.gamedb-coupon-item-row {
  grid-template-columns: 48px minmax(10rem, 1fr) minmax(7rem, 9rem);
}

.gamedb-unitkey-item-list-header,
.gamedb-unitkey-item-row {
  grid-template-columns: 48px minmax(10rem, 1fr) minmax(5rem, 7rem) minmax(5rem, 7rem) minmax(8rem, 10rem) 5.5rem;
}

.gamedb-unit-defense-item-list-header,
.gamedb-unit-defense-item-row {
  grid-template-columns: 48px minmax(10rem, 1fr) minmax(5rem, 7.5rem) minmax(12rem, 1.4fr) 5.5rem;
}

.gamedb-unit-weapon-item-list-header,
.gamedb-unit-weapon-item-row {
  grid-template-columns: 48px minmax(10rem, 1fr) minmax(7rem, 9rem) minmax(6.5rem, 8rem) minmax(12rem, 1.3fr) 5.5rem;
}

.gamedb-unit-back-item-list-header,
.gamedb-unit-back-item-row {
  grid-template-columns: 48px minmax(10rem, 1fr) minmax(6rem, 7rem) minmax(7rem, 8.5rem) minmax(12rem, 1.3fr) 5.5rem;
}

.gamedb-unit-bullet-item-list-header,
.gamedb-unit-bullet-item-row {
  grid-template-columns: 48px minmax(10rem, 1fr) minmax(6rem, 7rem) minmax(7rem, 9rem);
}

.gamedb-durability-item-list-header,
.gamedb-durability-item-row {
  grid-template-columns: 48px minmax(10rem, 1fr) minmax(8rem, 10rem) 5.5rem;
}

.gamedb-defense-item-list-header,
.gamedb-defense-item-row {
  grid-template-columns: 48px minmax(10rem, 1fr) minmax(5rem, 7.5rem) minmax(6rem, 8.5rem) 5.5rem 8rem;
}

.gamedb-shield-defense-item-list-header,
.gamedb-shield-defense-item-row {
  grid-template-columns: 48px minmax(10rem, 1fr) minmax(5rem, 7.5rem) minmax(6rem, 8.5rem) 5.5rem;
}

.gamedb-effects-item-list-header,
.gamedb-effects-item-row {
  grid-template-columns: 48px minmax(10rem, 1fr) minmax(14rem, 1.5fr) 5.5rem;
}

.gamedb-siegekit-item-list-header,
.gamedb-siegekit-item-row {
  grid-template-columns: 48px minmax(10rem, 1fr) minmax(14rem, 1.5fr) 5.5rem 8rem;
}

.gamedb-attack-item-list-header,
.gamedb-attack-item-row {
  grid-template-columns: 48px minmax(10rem, 1fr) minmax(7rem, 9rem) minmax(7rem, 9rem) minmax(12rem, 1.4fr) 5.5rem;
}

.gamedb-skill-item-list-header,
.gamedb-skill-item-row {
  grid-template-columns: 48px minmax(10rem, 1fr) minmax(7rem, 9rem) minmax(8rem, 1fr) minmax(10rem, 1.2fr);
}

.gamedb-item-list-header {
  padding: .15rem .6rem;
  color: #9ca5b5;
  font-size: .65rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.gamedb-item-sort-cell {
  min-width: 0;
}

.gamedb-item-sort {
  display: inline-flex;
  align-items: flex-start;
  max-width: 100%;
  width: 100%;
  gap: .25rem;
  padding: 0;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
  font: inherit;
  letter-spacing: inherit;
  text-align: left;
  text-transform: inherit;
}

.gamedb-item-sort:hover,
.gamedb-item-sort:focus-visible,
.gamedb-item-sort.active {
  color: var(--gamedb-gold);
}

.gamedb-item-sort:focus-visible {
  outline: 1px solid var(--gamedb-gold);
  outline-offset: .15rem;
}

.gamedb-item-sort-label {
  min-width: 0;
  overflow-wrap: anywhere;
  white-space: normal;
  line-height: 1.15;
}

.gamedb-item-sort-arrow {
  width: .7rem;
  flex: 0 0 .7rem;
  margin-top: .12em;
  color: var(--gamedb-gold);
  font-size: .6rem;
  line-height: 1;
}

.gamedb-item-row {
  min-height: 48px;
  padding: .35rem .6rem;
  border: 1px solid var(--gamedb-bg-light);
  border-radius: .3rem;
  cursor: pointer;
  background: var(--gamedb-bg);
}

.gamedb-item-row:hover {
  border-color: var(--gamedb-gold);
}

.gamedb-item-row img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  background: radial-gradient(circle, rgba(255,255,255,.06) 0%, rgba(255,255,255,0) 70%);
  border-radius: .2rem;
}

.gamedb-item-row-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gamedb-item-row-level,
.gamedb-item-row-race,
.gamedb-item-row-defense,
.gamedb-item-row-extra-defense,
.gamedb-weapon-row-attack,
.gamedb-weapon-row-force-attack,
.gamedb-ammo-row-count,
.gamedb-coupon-row-discount,
.gamedb-unitkey-row-type,
.gamedb-unit-row-delay,
.gamedb-unit-row-energy,
.gamedb-unit-row-speed,
.gamedb-item-row-durability,
.gamedb-unitkey-row-durability,
.gamedb-skill-row-type,
.gamedb-skill-row-target,
.gamedb-skill-row-weapon {
  color: #b7bfcd;
  font-size: .75rem;
  white-space: nowrap;
}

.gamedb-item-row-defense,
.gamedb-item-row-extra-defense,
.gamedb-weapon-row-attack,
.gamedb-weapon-row-force-attack,
.gamedb-ammo-row-count,
.gamedb-coupon-row-discount,
.gamedb-unitkey-row-type,
.gamedb-unit-row-delay,
.gamedb-unit-row-energy,
.gamedb-unit-row-speed,
.gamedb-item-row-durability,
.gamedb-unitkey-row-durability {
  text-align: center;
}

.gamedb-skill-row-target,
.gamedb-skill-row-weapon {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gamedb-unit-row-element {
  min-width: 0;
  color: #b7bfcd;
  font-size: .7rem;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.gamedb-weapon-row-effects {
  min-width: 0;
  color: #b7bfcd;
  font-size: .7rem;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.gamedb-item-effect-line {
  display: block;
}

.gamedb-filter-reset {
  padding: .3rem .65rem;
  color: #b7bfcd;
  background: var(--gamedb-bg);
  border: 1px solid var(--gamedb-bg-light);
  border-radius: .3rem;
  cursor: pointer;
  font-size: .75rem;
}

.gamedb-filter-reset:hover {
  border-color: var(--gamedb-gold);
  color: var(--gamedb-gold);
  background: var(--gamedb-bg-light);
}

.gamedb-quest-list {
  display: flex;
  flex-direction: column;
  gap: .3rem;
}

.gamedb-quest-list-header,
.gamedb-quest-row {
  display: grid;
  grid-template-columns: 44px minmax(12rem, 1.1fr) 4.5rem minmax(5.5rem, .45fr) minmax(6rem, .55fr) minmax(12rem, 1fr) minmax(12rem, 1fr);
  align-items: center;
  gap: .65rem;
}

.gamedb-quest-list-header {
  padding: .15rem .6rem;
  color: #9ca5b5;
  font-size: .65rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.gamedb-quest-row {
  min-height: 58px;
  padding: .45rem .6rem;
  border: 1px solid var(--gamedb-bg-light);
  border-radius: .3rem;
  cursor: pointer;
  background: var(--gamedb-bg);
}

.gamedb-quest-row:hover {
  border-color: var(--gamedb-gold);
}

.gamedb-quest-row > img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  background: radial-gradient(circle, rgba(255,255,255,.06) 0%, rgba(255,255,255,0) 70%);
  border-radius: .2rem;
}

.gamedb-quest-row-main {
  min-width: 0;
  display: grid;
  gap: .15rem;
}

.gamedb-quest-row-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #eef2f8;
  font-weight: 700;
}

.gamedb-quest-row-description {
  display: -webkit-box;
  min-width: 0;
  color: #9ca5b5;
  font-size: .68rem;
  line-height: 1.25;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.gamedb-quest-row-level,
.gamedb-quest-row-race,
.gamedb-quest-row-class {
  color: #c3cbd8;
  font-size: .74rem;
  white-space: nowrap;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gamedb-quest-row-level {
  color: var(--gamedb-gold);
  font-weight: 700;
}

.gamedb-quest-row-objectives,
.gamedb-quest-row-rewards {
  min-width: 0;
  display: grid;
  gap: .18rem;
  color: #c3cbd8;
  font-size: .68rem;
  line-height: 1.25;
}

.gamedb-quest-muted {
  color: #7f8999;
  font-size: .68rem;
}

.gamedb-quest-objective-entry,
.gamedb-quest-reward-entry {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: .28rem;
  color: inherit;
  text-decoration: none;
}

.gamedb-quest-objective-entry img,
.gamedb-quest-reward-entry img {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  object-fit: contain;
  background: #0d1119;
  border: 1px solid var(--gamedb-bg-light);
  border-radius: .18rem;
}

.gamedb-quest-objective-entry span,
.gamedb-quest-reward-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gamedb-item-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: .3rem;
  margin-top: .75rem;
}

.gamedb-page-btn {
  min-width: 2rem;
  height: 2rem;
  padding: 0 .5rem;
  color: #c7ced9;
  background: var(--gamedb-bg);
  border: 1px solid var(--gamedb-bg-light);
  border-radius: .25rem;
  cursor: pointer;
}

.gamedb-page-btn:hover:not(:disabled) {
  color: var(--gamedb-gold);
  border-color: var(--gamedb-gold);
}

.gamedb-page-btn.active {
  color: #151a23;
  background: var(--gamedb-gold);
  border-color: var(--gamedb-gold);
  font-weight: 700;
}

.gamedb-page-btn:disabled:not(.active) {
  opacity: .35;
  cursor: default;
}

.gamedb-page-ellipsis {
  min-width: 1.2rem;
  color: #7f8999;
  text-align: center;
}

.gamedb-item-empty {
  margin: 0;
  padding: 1rem;
  color: #9ca5b5;
  text-align: center;
  border: 1px dashed var(--gamedb-bg-light);
  border-radius: .3rem;
}

@media (max-width: 700px) {
  .gamedb-mob-list-header {
    display: none;
  }

  .gamedb-mob-row,
  .gamedb-dropped-mob-list .gamedb-dropped-mob-row {
    grid-template-columns: 42px minmax(0, 1fr) auto;
    gap: .15rem .6rem;
  }

  .gamedb-mob-row img {
    width: 42px;
    height: 42px;
    grid-row: 1 / span 2;
  }

  .gamedb-mob-row-name {
    grid-column: 2;
    grid-row: 1;
  }

  .gamedb-mob-row-level {
    grid-column: 3;
    grid-row: 1;
  }

  .gamedb-mob-row-grade {
    grid-column: 3;
    grid-row: 2;
  }

  .gamedb-dropped-mob-list .gamedb-dropped-mob-chance {
    grid-column: 2;
    grid-row: 2;
    justify-self: start;
    text-align: left;
  }

  .gamedb-item-list-header {
    display: none;
  }

  .gamedb-item-row {
    grid-template-columns: 42px minmax(0, 1fr) auto;
    gap: .15rem .6rem;
  }

  .gamedb-item-row img {
    width: 42px;
    height: 42px;
    grid-row: 1 / span 2;
  }

  .gamedb-item-row-name {
    grid-column: 2;
    grid-row: 1;
  }

  .gamedb-item-row-level {
    grid-column: 3;
    grid-row: 1;
  }

  .gamedb-item-row-race {
    grid-column: 2 / span 2;
    grid-row: 2;
    font-size: .68rem;
  }

  .gamedb-quest-list-header {
    display: none;
  }

  .gamedb-quest-row {
    grid-template-columns: 42px minmax(0, 1fr) auto;
    gap: .22rem .6rem;
  }

  .gamedb-quest-row > img {
    width: 42px;
    height: 42px;
    grid-row: 1 / span 4;
  }

  .gamedb-quest-row-main {
    grid-column: 2;
    grid-row: 1;
  }

  .gamedb-quest-row-level {
    grid-column: 3;
    grid-row: 1;
    text-align: right;
  }

  .gamedb-quest-row-race {
    grid-column: 2;
    grid-row: 2;
  }

  .gamedb-quest-row-class {
    grid-column: 3;
    grid-row: 2;
    text-align: right;
  }

  .gamedb-quest-row-objectives {
    grid-column: 2 / span 2;
    grid-row: 3;
  }

  .gamedb-quest-row-rewards {
    grid-column: 2 / span 2;
    grid-row: 4;
  }

  .gamedb-quest-objective-entry span,
  .gamedb-quest-reward-text {
    white-space: normal;
  }

  .gamedb-name-only-item-row {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .gamedb-name-only-item-row img {
    grid-row: 1;
  }

  .gamedb-ammo-item-row {
    grid-template-columns: 42px minmax(0, 1fr) auto;
  }

  .gamedb-ammo-item-row img {
    grid-row: 1;
  }

  .gamedb-ammo-item-row .gamedb-ammo-row-count {
    grid-column: 3;
    grid-row: 1;
    text-align: right;
  }

  .gamedb-coupon-item-row {
    grid-template-columns: 42px minmax(0, 1fr) auto;
  }

  .gamedb-coupon-item-row img {
    grid-row: 1;
  }

  .gamedb-coupon-item-row .gamedb-coupon-row-discount {
    grid-column: 3;
    grid-row: 1;
    text-align: right;
  }

  .gamedb-unitkey-item-row {
    grid-template-columns: 42px minmax(0, 1fr) auto;
  }

  .gamedb-unitkey-item-row img {
    grid-row: 1 / span 4;
  }

  .gamedb-unitkey-item-row .gamedb-unitkey-row-type {
    grid-column: 3;
    grid-row: 1;
    text-align: right;
  }

  .gamedb-unitkey-item-row .gamedb-item-row-defense {
    grid-column: 2 / span 2;
    grid-row: 2;
    text-align: left;
  }

  .gamedb-unitkey-item-row .gamedb-unitkey-row-durability {
    grid-column: 2 / span 2;
    grid-row: 3;
    text-align: left;
  }

  .gamedb-unitkey-item-row .gamedb-item-row-race {
    grid-row: 4;
  }

  .gamedb-unitkey-item-row .gamedb-item-row-defense::before,
  .gamedb-unitkey-item-row .gamedb-unitkey-row-durability::before {
    content: attr(data-label) ": ";
    color: #7f8999;
  }

  .gamedb-unit-defense-item-row img {
    grid-row: 1 / span 3;
  }

  .gamedb-unit-defense-item-row .gamedb-item-row-defense {
    grid-column: 2 / span 2;
    grid-row: 2;
    text-align: left;
  }

  .gamedb-unit-defense-item-row .gamedb-unit-row-element {
    grid-column: 2 / span 2;
    grid-row: 3;
    text-align: left;
  }

  .gamedb-unit-defense-item-row .gamedb-item-row-defense::before,
  .gamedb-unit-defense-item-row .gamedb-unit-row-element::before {
    content: attr(data-label) ": ";
    color: #7f8999;
  }

  .gamedb-unit-weapon-item-row img {
    grid-row: 1 / span 4;
  }

  .gamedb-unit-weapon-item-row .gamedb-weapon-row-attack {
    grid-column: 2 / span 2;
    grid-row: 2;
    text-align: left;
  }

  .gamedb-unit-weapon-item-row .gamedb-unit-row-delay {
    grid-column: 2 / span 2;
    grid-row: 3;
    text-align: left;
  }

  .gamedb-unit-weapon-item-row .gamedb-unit-row-element {
    grid-column: 2 / span 2;
    grid-row: 4;
    text-align: left;
  }

  .gamedb-unit-weapon-item-row .gamedb-weapon-row-attack::before,
  .gamedb-unit-weapon-item-row .gamedb-unit-row-delay::before,
  .gamedb-unit-weapon-item-row .gamedb-unit-row-element::before {
    content: attr(data-label) ": ";
    color: #7f8999;
  }

  .gamedb-unit-back-item-row img {
    grid-row: 1 / span 4;
  }

  .gamedb-unit-back-item-row .gamedb-unit-row-energy {
    grid-column: 2 / span 2;
    grid-row: 2;
    text-align: left;
  }

  .gamedb-unit-back-item-row .gamedb-unit-row-speed {
    grid-column: 2 / span 2;
    grid-row: 3;
    text-align: left;
  }

  .gamedb-unit-back-item-row .gamedb-unit-row-element {
    grid-column: 2 / span 2;
    grid-row: 4;
    text-align: left;
  }

  .gamedb-unit-back-item-row .gamedb-unit-row-energy::before,
  .gamedb-unit-back-item-row .gamedb-unit-row-speed::before,
  .gamedb-unit-back-item-row .gamedb-unit-row-element::before {
    content: attr(data-label) ": ";
    color: #7f8999;
  }

  .gamedb-unit-bullet-item-row {
    grid-template-columns: 42px minmax(0, 1fr) auto;
  }

  .gamedb-unit-bullet-item-row img {
    grid-row: 1 / span 2;
  }

  .gamedb-unit-bullet-item-row .gamedb-ammo-row-count {
    grid-column: 3;
    grid-row: 1;
    text-align: right;
  }

  .gamedb-unit-bullet-item-row .gamedb-weapon-row-attack {
    grid-column: 2 / span 2;
    grid-row: 2;
    text-align: left;
  }

  .gamedb-unit-bullet-item-row .gamedb-weapon-row-attack::before {
    content: attr(data-label) ": ";
    color: #7f8999;
  }

  .gamedb-durability-item-row img {
    grid-row: 1 / span 2;
  }

  .gamedb-durability-item-row .gamedb-item-row-durability {
    grid-column: 2 / span 2;
    grid-row: 2;
    text-align: left;
  }

  .gamedb-durability-item-row .gamedb-item-row-durability::before {
    content: attr(data-label) ": ";
    color: #7f8999;
  }

  .gamedb-defense-item-row img {
    grid-row: 1 / span 3;
  }

  .gamedb-defense-item-row .gamedb-item-row-defense {
    grid-column: 2;
    grid-row: 2;
    text-align: left;
  }

  .gamedb-defense-item-row .gamedb-item-row-extra-defense {
    grid-column: 3;
    grid-row: 2;
    text-align: right;
  }

  .gamedb-defense-item-row .gamedb-item-row-race {
    grid-row: 3;
  }

  .gamedb-defense-item-row .gamedb-item-row-defense::before,
  .gamedb-defense-item-row .gamedb-item-row-extra-defense::before {
    content: attr(data-label) ": ";
    color: #7f8999;
  }

  .gamedb-shield-defense-item-row img {
    grid-row: 1 / span 2;
  }

  .gamedb-shield-defense-item-row .gamedb-item-row-defense {
    grid-column: 2;
    grid-row: 2;
    text-align: left;
  }

  .gamedb-shield-defense-item-row .gamedb-item-row-extra-defense {
    grid-column: 3;
    grid-row: 2;
    text-align: right;
  }

  .gamedb-shield-defense-item-row .gamedb-item-row-defense::before,
  .gamedb-shield-defense-item-row .gamedb-item-row-extra-defense::before {
    content: attr(data-label) ": ";
    color: #7f8999;
  }

  .gamedb-effects-item-row img {
    grid-row: 1 / span 2;
  }

  .gamedb-effects-item-row .gamedb-weapon-row-effects {
    grid-column: 2 / span 2;
    grid-row: 2;
    text-align: left;
  }

  .gamedb-effects-item-row .gamedb-weapon-row-effects::before {
    content: attr(data-label) ": ";
    color: #7f8999;
  }

  .gamedb-siegekit-item-row img {
    grid-row: 1 / span 3;
  }

  .gamedb-siegekit-item-row .gamedb-weapon-row-effects {
    grid-column: 2 / span 2;
    grid-row: 2;
    text-align: left;
  }

  .gamedb-siegekit-item-row .gamedb-item-row-race {
    grid-column: 2 / span 2;
    grid-row: 3;
    text-align: left;
  }

  .gamedb-siegekit-item-row .gamedb-weapon-row-effects::before {
    content: attr(data-label) ": ";
    color: #7f8999;
  }

  .gamedb-attack-item-row img {
    grid-row: 1 / span 4;
  }

  .gamedb-attack-item-row .gamedb-weapon-row-attack {
    grid-column: 2 / span 2;
    grid-row: 2;
    text-align: left;
  }

  .gamedb-attack-item-row .gamedb-weapon-row-force-attack {
    grid-column: 2 / span 2;
    grid-row: 3;
    text-align: left;
  }

  .gamedb-attack-item-row .gamedb-weapon-row-effects {
    grid-column: 2 / span 2;
    grid-row: 4;
    text-align: left;
  }

  .gamedb-attack-item-row .gamedb-weapon-row-attack::before,
  .gamedb-attack-item-row .gamedb-weapon-row-force-attack::before,
  .gamedb-attack-item-row .gamedb-weapon-row-effects::before {
    content: attr(data-label) ": ";
    color: #7f8999;
  }

  .gamedb-skill-item-row img {
    grid-row: 1 / span 4;
  }

  .gamedb-skill-item-row .gamedb-skill-row-type {
    grid-column: 2 / span 2;
    grid-row: 2;
    text-align: left;
  }

  .gamedb-skill-item-row .gamedb-skill-row-target {
    grid-column: 2 / span 2;
    grid-row: 3;
    text-align: left;
    white-space: normal;
  }

  .gamedb-skill-item-row .gamedb-skill-row-weapon {
    grid-column: 2 / span 2;
    grid-row: 4;
    text-align: left;
    white-space: normal;
  }

  .gamedb-skill-item-row .gamedb-skill-row-type::before,
  .gamedb-skill-item-row .gamedb-skill-row-target::before,
  .gamedb-skill-item-row .gamedb-skill-row-weapon::before {
    content: attr(data-label) ": ";
    color: #7f8999;
  }
}

/* item tooltip modal, styled after the in-game item tooltip */
.gamedb-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 8, 14, .6);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 4rem 1rem;
  z-index: 100;
  overflow-y: auto;
}

.gamedb-tooltip {
  --gamedb-bg: var(--md-primary-fg-color, #1b2433);
  --gamedb-bg-light: var(--md-primary-fg-color--light, #2c3a52);
  --gamedb-gold: var(--md-accent-fg-color, #d8a657);
  width: min(28rem, 100%);
  background: linear-gradient(180deg, #1b2433, #11161f);
  border: 1px solid var(--gamedb-gold);
  border-radius: .4rem;
  box-shadow: 0 0 0 1px rgba(216, 166, 87, .25), 0 1rem 2rem rgba(0, 0, 0, .5);
  padding: 1rem;
}

.gamedb-tooltip-quest {
  width: min(52rem, 100%);
}

.gamedb-tooltip-mob {
  width: min(52rem, 100%);
}

.gamedb-tooltip-header {
  display: flex;
  gap: .75rem;
  align-items: center;
  border-bottom: 1px solid var(--gamedb-bg-light);
  padding-bottom: .6rem;
  margin-bottom: .6rem;
}

.gamedb-tooltip-header img {
  width: 84px;
  height: 84px;
  object-fit: contain;
  border: 1px solid var(--gamedb-bg-light);
  border-radius: .25rem;
  background: #0d1119;
}

.gamedb-tooltip-title {
  color: var(--gamedb-gold);
  font-weight: 700;
  font-size: 1rem;
}

.gamedb-tooltip-subtitle {
  opacity: .65;
  font-size: .7rem;
}

.gamedb-tooltip-close {
  margin-left: auto;
  cursor: pointer;
  opacity: .6;
  font-size: 1.1rem;
  line-height: 1;
}

.gamedb-tooltip-close:hover {
  opacity: 1;
}

.gamedb-tooltip table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: .6rem;
}

.gamedb-tooltip table td {
  padding: .15rem 0;
  border: none;
  font-size: .75rem;
}

.gamedb-tooltip table td:first-child {
  opacity: .6;
  width: 40%;
}

.gamedb-mob-grade-icon {
  width: 1.1rem;
  height: 1.1rem;
  vertical-align: middle;
}

.gamedb-mob-attribute-icon {
  width: 1.1rem;
  height: 1.1rem;
  object-fit: contain;
  vertical-align: middle;
}

.gamedb-icon-text {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
}

.gamedb-icon-text .gamedb-mob-attribute-icon,
.gamedb-icon-text .gamedb-mob-grade-icon,
.gamedb-icon-text .gamedb-mob-unknown-icon {
  flex: 0 0 auto;
}

.gamedb-mob-unknown-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.1rem;
  height: 1.1rem;
  color: #dfe8f5;
  background: #202833;
  border: 1px solid #8fa5bc;
  border-radius: .1rem;
  font-size: .72rem;
  font-weight: 700;
  line-height: 1;
  vertical-align: middle;
}

.gamedb-tooltip-section-title {
  color: var(--gamedb-gold);
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  margin: .6rem 0 .3rem;
}

.gamedb-tooltip-description {
  font-size: .78rem;
  line-height: 1.4;
  opacity: .9;
}

/* Game-style item cards keep in-game stats visually separate from database metadata. */
.gamedb-tooltip.gamedb-tooltip-game-item {
  width: min(40rem, 100%);
  background: linear-gradient(145deg, #0d1a27 0%, #0a141f 100%);
  border-color: #8fa5bc;
  border-radius: .15rem;
  box-shadow: 0 0 0 1px rgba(8, 14, 22, .9), 0 1.2rem 3rem rgba(0, 0, 0, .58);
  padding: .9rem 1rem 1rem;
  color: #f3f6fa;
}

.gamedb-tooltip.gamedb-tooltip-skill {
  width: min(30rem, 100%);
}

.gamedb-tooltip-game-item .gamedb-tooltip-header {
  align-items: flex-start;
  border-bottom: 0;
  margin-bottom: .7rem;
  padding-bottom: 0;
}

.gamedb-tooltip-title-wrap {
  min-width: 0;
}

.gamedb-tooltip-game-item .gamedb-tooltip-header img {
  width: 64px;
  height: 64px;
  flex: 0 0 64px;
  border-color: #71869d;
  border-radius: 0;
  background: #09121c;
}

.gamedb-tooltip-game-item .gamedb-tooltip-title {
  color: #f2e169;
  font-size: 1.06rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.gamedb-tooltip-game-item .gamedb-tooltip-close {
  color: #b9c9da;
}

.gamedb-game-panel {
  padding: .15rem .15rem 0;
  font-size: .81rem;
  line-height: 1.35;
  font-variant-numeric: tabular-nums;
}

.gamedb-game-stat {
  display: grid;
  grid-template-columns: 10.5rem minmax(0, 1fr);
  gap: .75rem;
  padding: .16rem 0;
}

.gamedb-game-stat-label {
  color: #8bb8e7;
  text-align: right;
}

.gamedb-game-stat-value {
  min-width: 0;
  color: #f5f7fb;
  overflow-wrap: anywhere;
}

.gamedb-game-level-value {
  color: #f5f7fb;
}

.gamedb-game-effects {
  display: grid;
  gap: .12rem;
}

.gamedb-game-materials {
  display: grid;
  gap: .12rem;
  margin-top: .2rem;
  color: #f5f7fb;
  font-variant-numeric: tabular-nums;
}

.gamedb-game-upgrades {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .22rem;
  min-height: 1.25rem;
  padding-left: .12rem;
}

.gamedb-game-upgrade-slot {
  display: inline-block;
  width: .72rem;
  height: 1.05rem;
  background: url("irtal00.png") center / contain no-repeat;
}

.gamedb-game-description-label {
  width: 100%;
  margin-top: .75rem;
  color: #8bb8e7;
  text-align: left;
}

.gamedb-game-description {
  width: 100%;
  margin-top: .25rem;
  color: #e4eaf1;
  line-height: 1.45;
  text-align: left;
}

.gamedb-mob-game-panel {
  position: relative;
  width: 232px;
  height: 65px;
  max-width: 100%;
  box-sizing: border-box;
  margin: .15rem auto .75rem;
  padding: 0;
  color: #f8fbff;
  background: url("mob-attributes/mob-info-frame.png") center / 100% 100% no-repeat;
}

.gamedb-mob-plate-name {
  position: absolute;
  top: 4px;
  right: 35px;
  left: 38px;
  height: 16px;
  min-height: 0;
  padding: 0 4px;
  color: #fff;
  background: none;
  border: 0;
  font-size: 12px;
  font-weight: 500;
  line-height: 16px;
  text-align: center;
  text-shadow: 0 1px 1px #000, 0 0 4px #000;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gamedb-mob-plate-hp {
  position: absolute;
  top: 21px;
  left: 39px;
  width: 156px;
  height: 8px;
  background: url("mob-attributes/mob-hp-bar.png") left top / 156px 8px no-repeat;
}

.gamedb-mob-plate-strip {
  position: absolute;
  top: 34px;
  right: 54px;
  left: 54px;
  height: 18px;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  gap: 1px;
  min-height: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background: none;
  border: 0;
  box-shadow: none;
}

.gamedb-mob-plate-icon {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

.gamedb-field-label-help {
  cursor: help;
  text-decoration: underline dotted rgba(145, 188, 231, .72);
  text-underline-offset: .16rem;
}

.gamedb-mob-resistance-panel {
  margin-top: .85rem;
}

.gamedb-mob-resistance-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(5.2rem, 1fr));
  margin-top: .45rem;
  background: rgba(39, 24, 25, .78);
  border: 1px solid rgba(143, 165, 188, .18);
}

.gamedb-mob-resistance-cell {
  display: grid;
  grid-template-rows: auto auto;
  gap: .45rem;
  min-width: 0;
  padding: .55rem .6rem .6rem;
  border-right: 1px solid rgba(143, 165, 188, .16);
}

.gamedb-mob-resistance-cell:last-child {
  border-right: 0;
}

.gamedb-mob-resistance-cell .gamedb-icon-text {
  min-width: 0;
  color: #fff;
  font-weight: 600;
}

.gamedb-mob-resistance-cell strong {
  color: #fff;
  font-size: .9rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.gamedb-item-meta {
  margin-top: .9rem;
  border-top: 1px solid rgba(143, 165, 188, .32);
  padding-top: .65rem;
  font-size: .75rem;
}

.gamedb-item-meta-title {
  color: #91bce7;
  text-align: left;
}

.gamedb-item-meta-grid {
  display: grid;
  grid-template-columns: 10.5rem minmax(0, 1fr);
  gap: .3rem .75rem;
  margin-top: .6rem;
  padding: .65rem;
  background: rgba(3, 9, 15, .28);
  border: 1px solid rgba(143, 165, 188, .16);
}

.gamedb-item-meta-label {
  color: #7d9ab8;
  text-align: right;
}

.gamedb-item-meta-value {
  min-width: 0;
  color: #d6dee8;
  overflow-wrap: anywhere;
}

.gamedb-tooltip-game-item .gamedb-tooltip-section-title {
  color: #91bce7;
  border-top: 1px solid rgba(143, 165, 188, .25);
  margin-top: .9rem;
  padding-top: .65rem;
}

/* Cross-link previews reuse the exact in-game block from the full card. */
.gamedb-entity-preview.gamedb-tooltip-game-item {
  width: min(40rem, calc(100vw - 1rem));
  max-height: calc(100vh - 1rem);
  overflow-y: auto;
  pointer-events: none;
}

/* Plain items carry far fewer stat rows than equipment - a narrower card
   keeps the hover preview from looking mostly empty. */
.gamedb-entity-preview.gamedb-tooltip-item,
.gamedb-entity-preview.gamedb-tooltip-force,
.gamedb-entity-preview.gamedb-tooltip-skill,
.gamedb-entity-preview.gamedb-tooltip-battery,
.gamedb-entity-preview.gamedb-tooltip-ticket,
.gamedb-entity-preview.gamedb-tooltip-npclink,
.gamedb-entity-preview.gamedb-tooltip-coupon {
  width: min(26rem, calc(100vw - 1rem));
}

.gamedb-entity-preview.gamedb-tooltip-game-item .gamedb-tooltip-header {
  margin-bottom: .7rem;
}

@media (max-width: 480px) {
  .gamedb-overlay {
    padding: 1rem .5rem;
  }

  .gamedb-tooltip.gamedb-tooltip-game-item {
    padding: .75rem;
  }

  .gamedb-game-stat,
  .gamedb-item-meta-grid {
    grid-template-columns: minmax(7.25rem, 41%) minmax(0, 1fr);
    gap: .5rem;
  }
}

.gamedb-link-row {
  display: flex;
  align-items: center;
  gap: .4rem;
  padding: .25rem .3rem;
  border-radius: .2rem;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

.gamedb-link-row:hover {
  background: var(--gamedb-bg-light);
}

.gamedb-link-row img {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.gamedb-loot {
  margin-bottom: .6rem;
}

.gamedb-loot-toolbar {
  margin-top: .2rem;
  margin-bottom: .5rem;
}

.gamedb-loot-search {
  box-sizing: border-box;
  width: 100%;
  background: var(--gamedb-bg-light);
  color: #e8ecf4;
  border: 1px solid rgba(216, 166, 87, .35);
  border-radius: .3rem;
  padding: .4rem .6rem;
  font-size: .75rem;
}

.gamedb-loot-search::placeholder {
  color: #9aa5b8;
}

.gamedb-loot-search:focus {
  outline: none;
  border-color: var(--gamedb-gold);
  box-shadow: 0 0 0 1px rgba(216, 166, 87, .35);
}

.gamedb-loot-table-wrap {
  max-height: 14rem;
  overflow-y: auto;
  border: 1px solid var(--gamedb-bg-light);
  border-radius: .3rem;
}

.gamedb-loot-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .72rem;
  margin-bottom: 0;
}

.gamedb-loot-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #1b2433;
  text-align: left;
  padding: .35rem .5rem;
  border: none;
  border-bottom: 1px solid var(--gamedb-bg-light);
  font-weight: 600;
  opacity: .7;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.gamedb-loot-table th:hover,
.gamedb-loot-table th.active {
  opacity: 1;
  color: var(--gamedb-gold);
}

.gamedb-loot-table th:last-child,
.gamedb-loot-table td:last-child {
  text-align: right;
  width: 5.5rem;
}

.gamedb-loot-table td {
  padding: 0;
  border: none;
  border-bottom: 1px solid var(--gamedb-bg-light);
  font-size: .75rem;
}

.gamedb-loot-table td:first-child {
  opacity: 1;
  width: auto;
}

.gamedb-loot-table tr:last-child td {
  border-bottom: none;
}

.gamedb-loot-table .gamedb-link-row {
  padding: .3rem .5rem;
  border-radius: 0;
}

.gamedb-loot-chance {
  padding: .3rem .5rem !important;
  opacity: .85;
  white-space: nowrap;
}

.gamedb-loot-table td.gamedb-loot-empty {
  padding: .6rem;
  text-align: center;
  width: auto;
  opacity: .6;
}

.gamedb-3d-wrap {
  display: flex;
  justify-content: center;
  min-height: 2.5rem;
}

.gamedb-3d-wrap canvas {
  border-radius: .3rem;
  background: #0d1119;
}

.gamedb-3d-button {
  background: var(--gamedb-bg-light);
  color: var(--gamedb-gold);
  border: 1px solid var(--gamedb-gold);
  border-radius: .25rem;
  padding: .5rem 1rem;
  cursor: pointer;
  font-size: .78rem;
}

.gamedb-3d-button:hover {
  background: var(--gamedb-gold);
  color: #1b2433;
}

.gamedb-3d-button:disabled {
  opacity: .6;
  cursor: default;
}

.gamedb-domain-tag {
  font-size: .6rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: .05rem .35rem;
  border-radius: .6rem;
  border: 1px solid var(--gamedb-bg-light);
  opacity: .75;
}

.gamedb-quest-card {
  display: grid;
  gap: .45rem;
}

.gamedb-quest-chain-section {
  min-width: 0;
  margin-top: .15rem;
}

.gamedb-quest-chain-title-row {
  display: flex;
  align-items: baseline;
  gap: .5rem;
}

.gamedb-quest-chain-title-row .gamedb-tooltip-section-title {
  margin-bottom: .25rem;
}

.gamedb-quest-chain-count {
  color: #8d98a8;
  font-size: .66rem;
  white-space: nowrap;
}

.gamedb-quest-chain-body {
  min-width: 0;
}

.gamedb-quest-chain-track {
  display: flex;
  align-items: stretch;
  gap: .35rem;
  max-width: 100%;
  overflow-x: auto;
  padding: .05rem .05rem .25rem;
}

.gamedb-quest-chain-node {
  box-sizing: border-box;
  flex: 0 0 11rem;
  display: grid;
  align-content: center;
  gap: .16rem;
  min-width: 0;
  max-width: 70vw;
  min-height: 3.25rem;
  padding: .45rem .55rem;
  color: #d8deea;
  background: rgba(255, 255, 255, .025);
  border: 1px solid var(--gamedb-bg-light);
  border-radius: .25rem;
  text-decoration: none;
}

.gamedb-quest-chain-node:hover {
  color: #eef2f8;
  border-color: var(--gamedb-gold);
  background: rgba(216, 166, 87, .08);
}

.gamedb-quest-chain-node.active {
  color: #151a23;
  background: var(--gamedb-gold);
  border-color: var(--gamedb-gold);
}

.gamedb-quest-chain-name {
  display: -webkit-box;
  min-width: 0;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-height: 1.22;
  font-size: .72rem;
  font-weight: 700;
}

.gamedb-quest-chain-meta {
  min-width: 0;
  color: #9ca5b5;
  font-size: .62rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gamedb-quest-chain-node.active .gamedb-quest-chain-meta {
  color: rgba(21, 26, 35, .72);
}

.gamedb-quest-chain-arrow {
  flex: 0 0 auto;
  align-self: center;
  color: var(--gamedb-gold);
  font-size: .95rem;
  line-height: 1;
}

.gamedb-quest-chain-edges {
  display: grid;
  gap: .3rem;
  max-width: 100%;
  overflow-x: auto;
}

.gamedb-quest-chain-edge {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: stretch;
  gap: .35rem;
  min-width: min(28rem, 100%);
}

.gamedb-quest-chain-edge .gamedb-quest-chain-node {
  flex-basis: auto;
  max-width: none;
  width: 100%;
}

.gamedb-quest-meta-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: .35rem;
  margin-bottom: .25rem;
}

.gamedb-quest-meta-item {
  min-width: 0;
}

.gamedb-quest-meta-label,
.gamedb-quest-meta-value {
  display: block;
  min-width: 0;
}

.gamedb-quest-meta-label {
  color: #8d98a8;
  font-size: .62rem;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.gamedb-quest-meta-value {
  margin-top: .1rem;
  color: #eef2f8;
  font-size: .78rem;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gamedb-quest-detail-list,
.gamedb-quest-detail-rewards {
  display: grid;
  gap: .3rem;
}

.gamedb-quest-detail-row {
  width: 100%;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .35rem .45rem;
  color: #d8deea;
  background: rgba(255, 255, 255, .025);
  border: 1px solid var(--gamedb-bg-light);
  border-radius: .25rem;
  font: inherit;
  text-align: left;
}

button.gamedb-quest-detail-row {
  cursor: pointer;
}

button.gamedb-quest-detail-row:hover {
  border-color: var(--gamedb-gold);
  background: rgba(216, 166, 87, .08);
}

.gamedb-quest-detail-row img {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  object-fit: contain;
  background: #0d1119;
  border: 1px solid var(--gamedb-bg-light);
  border-radius: .2rem;
}

.gamedb-quest-detail-text {
  min-width: 0;
  display: grid;
  gap: .05rem;
}

.gamedb-quest-detail-text strong {
  color: var(--gamedb-gold);
  font-size: .68rem;
}

.gamedb-quest-detail-text span {
  overflow-wrap: anywhere;
}

.gamedb-quest-detail-rewards {
  grid-template-columns: 1fr;
}

.gamedb-quest-detail-rewards .gamedb-quest-reward-entry {
  padding: .35rem .45rem;
  background: rgba(255, 255, 255, .025);
  border: 1px solid var(--gamedb-bg-light);
  border-radius: .25rem;
}

.gamedb-quest-reward-note {
  padding: .35rem .45rem;
  color: var(--gamedb-gold);
  background: rgba(216, 166, 87, .08);
  border: 1px solid rgba(216, 166, 87, .28);
  border-radius: .25rem;
  font-size: .72rem;
  font-weight: 700;
}

.gamedb-quest-reward-choice-badge {
  flex: 0 0 auto;
  margin-left: auto;
  padding: .08rem .35rem;
  color: var(--gamedb-gold);
  background: rgba(216, 166, 87, .08);
  border: 1px solid rgba(216, 166, 87, .28);
  border-radius: .2rem;
  font-size: .62rem;
  font-weight: 700;
  line-height: 1.35;
  text-transform: uppercase;
  white-space: nowrap;
}

.gamedb-quest-detail-rewards a.gamedb-quest-reward-entry:hover {
  border-color: var(--gamedb-gold);
  background: rgba(216, 166, 87, .08);
}

.gamedb-quest-map-section {
  margin-top: .35rem;
}

.gamedb-quest-map-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
  gap: .65rem;
}

.gamedb-quest-map-card {
  min-width: 0;
  padding: .55rem;
  background: rgba(255, 255, 255, .025);
  border: 1px solid var(--gamedb-bg-light);
  border-radius: .3rem;
}

.gamedb-quest-map-card-header {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: .35rem;
}

.gamedb-quest-map-title {
  min-width: 0;
  color: var(--gamedb-gold);
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gamedb-quest-map-link {
  margin-left: auto;
  color: #c3cbd8;
  font-size: .68rem;
  text-decoration: none;
  white-space: nowrap;
}

.gamedb-quest-map-link:hover {
  color: var(--gamedb-gold);
}

.gamedb-quest-map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem;
  margin-bottom: .4rem;
}

.gamedb-quest-map-chip {
  max-width: 100%;
  padding: .12rem .35rem;
  color: #dbe2ee;
  background: rgba(78, 224, 106, .12);
  border: 1px solid rgba(78, 224, 106, .35);
  border-radius: .25rem;
  font-size: .65rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gamedb-quest-map-svg {
  cursor: default;
  touch-action: auto;
}

@media (max-width: 700px) {
  .gamedb-quest-meta-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .gamedb-quest-detail-rewards,
  .gamedb-quest-map-list {
    grid-template-columns: minmax(0, 1fr);
  }

  .gamedb-quest-chain-track {
    gap: .28rem;
  }

  .gamedb-quest-chain-node {
    flex-basis: 9.5rem;
  }

  .gamedb-quest-chain-edge {
    min-width: 24rem;
  }
}

/* map view */
.gamedb-map-layout {
  display: flex;
  gap: .75rem;
  align-items: flex-start;
  flex-wrap: wrap;
}

.gamedb-map-sidebar {
  flex: 0 0 15rem;
}

.gamedb-map-sidebar-label {
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  opacity: .6;
  margin: 0 0 .3rem;
}

.gamedb-map-sidebar-label:not(:first-child) {
  margin-top: .75rem;
}

.gamedb-map-select,
.gamedb-map-mob-search {
  width: 100%;
  box-sizing: border-box;
  margin-bottom: .5rem;
  padding: .4rem .5rem;
  background: var(--gamedb-bg);
  color: #e8ecf4;
  border: 1px solid var(--gamedb-bg-light);
  border-radius: .25rem;
  font-size: .75rem;
}

.gamedb-map-mob-list {
  max-height: 30vh;
  overflow-y: auto;
  border: 1px solid var(--gamedb-bg-light);
  border-radius: .25rem;
}

.gamedb-map-mob-row {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .3rem .5rem;
  cursor: pointer;
  border-bottom: 1px solid var(--gamedb-bg-light);
  font-size: .75rem;
}

.gamedb-map-mob-row:last-child {
  border-bottom: none;
}

.gamedb-map-mob-row img {
  width: 24px;
  height: 24px;
  object-fit: contain;
  background: #0d1119;
  border-radius: .2rem;
  flex: 0 0 auto;
}

.gamedb-map-mob-row:hover {
  background: var(--gamedb-bg-light);
}

.gamedb-map-mob-row.active {
  background: rgba(216, 166, 87, .12);
  box-shadow: inset 0 0 0 1px var(--gamedb-gold);
  color: var(--gamedb-gold);
  font-weight: 600;
}

/* selected monster info, stacked below the mob list in the sidebar column */
.gamedb-map-info-panel {
  margin-top: .75rem;
  background: var(--gamedb-bg);
  border: 1px solid var(--gamedb-bg-light);
  border-radius: .3rem;
  padding: .6rem;
  box-sizing: border-box;
}

.gamedb-map-info-placeholder {
  font-size: .72rem;
  opacity: .65;
  line-height: 1.4;
  margin: 0;
}

.gamedb-map-mob-card-header {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: .5rem;
}

.gamedb-map-mob-card-header img {
  width: 42px;
  height: 42px;
  object-fit: contain;
  background: #0d1119;
  border: 1px solid var(--gamedb-bg-light);
  border-radius: .25rem;
}

.gamedb-map-mob-card-name {
  font-weight: 700;
  font-size: .82rem;
  color: var(--gamedb-gold);
}

.gamedb-map-mob-card-stats {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: .5rem;
}

.gamedb-map-mob-card-stats td {
  padding: .12rem 0;
  border: none;
  font-size: .75rem;
}

.gamedb-map-mob-card-stats td:first-child {
  opacity: .6;
  width: 45%;
}

.gamedb-map-mob-card-meta {
  font-size: .7rem;
  opacity: .8;
  margin-bottom: .2rem;
}

.gamedb-map-mob-card-btn {
  width: 100%;
  margin-top: .5rem;
  text-align: center;
}

/* right: toolbar + canvas */
.gamedb-map-main {
  flex: 1 1 16rem;
  min-width: 12rem;
}

.gamedb-map-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .9rem;
  margin-bottom: .5rem;
}

.gamedb-map-zoom-controls {
  display: flex;
  gap: .25rem;
}

.gamedb-map-tool-btn {
  min-width: 2rem;
  padding: .3rem .5rem;
  background: var(--gamedb-bg);
  color: #e8ecf4;
  border: 1px solid var(--gamedb-bg-light);
  border-radius: .25rem;
  cursor: pointer;
  font-size: .72rem;
}

.gamedb-map-tool-btn:hover {
  border-color: var(--gamedb-gold);
  color: var(--gamedb-gold);
}

.gamedb-map-toggle {
  display: flex;
  align-items: center;
  gap: .3rem;
  font-size: .72rem;
  opacity: .85;
  cursor: pointer;
  user-select: none;
}

.gamedb-map-level-badge {
  margin-left: auto;
  text-align: right;
  line-height: 1.2;
}

.gamedb-map-level-badge-label {
  display: block;
  font-size: .62rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  opacity: .6;
}

.gamedb-map-level-badge-value {
  display: block;
  font-size: .95rem;
  font-weight: 700;
  color: var(--gamedb-gold);
}

.gamedb-map-canvas-wrap {
  border: 1px solid var(--gamedb-bg-light);
  border-radius: .25rem;
  padding: .5rem;
}

.gamedb-map-svg {
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  background: #0d1119;
  border-radius: .2rem;
  cursor: grab;
  touch-action: none;
}

.gamedb-map-svg.dragging {
  cursor: grabbing;
}

.gamedb-map-grid line {
  stroke: #ffffff;
  stroke-opacity: .06;
  stroke-width: 1;
}

.gamedb-map-zone .spawn-point {
  opacity: .95;
}

.gamedb-map-npc-list {
  max-height: 22vh;
}

.gamedb-map-zone.dim .spawn-point {
  opacity: .3;
  filter: grayscale(1);
}

.gamedb-map-npc-marker.dim {
  opacity: .2;
  filter: grayscale(1);
}

.gamedb-map-npc-marker.active .gamedb-map-npc-sprite {
  filter: brightness(1.45) drop-shadow(0 0 5px #fff36a);
}

.gamedb-map-zone text {
  fill: var(--gamedb-gold);
  font-size: 11px;
  font-weight: 600;
  pointer-events: none;
}

.gamedb-map-zone.dim text {
  fill: #8b95a8;
  font-size: 9px;
  font-weight: 400;
  opacity: .55;
}

.gamedb-worldmap-gallery {
  margin-bottom: .75rem;
}

.gamedb-worldmap-strip {
  display: flex;
  gap: .5rem;
  overflow-x: auto;
  padding-bottom: .25rem;
}

.gamedb-worldmap-tile {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .25rem;
  width: 9rem;
}

.gamedb-worldmap-tile img {
  width: 9rem;
  height: 6.75rem;
  object-fit: cover;
  border-radius: .25rem;
  border: 1px solid var(--gamedb-bg-light);
}

.gamedb-worldmap-tile span {
  font-size: .65rem;
  opacity: .75;
  text-align: center;
}

.gamedb-map-toggle-npc {
  color: #ffe08a;
}

.gamedb-map-npc-marker {
  cursor: pointer;
  outline: none;
}

.gamedb-map-npc-sprite {
  pointer-events: none;
  image-rendering: auto;
}

.gamedb-map-npc-marker:hover .gamedb-map-npc-sprite,
.gamedb-map-npc-marker:focus .gamedb-map-npc-sprite {
  filter: brightness(1.35) drop-shadow(0 0 3px #ffe08a);
}

/* combination database */
.gamedb-combination-list {
  display: grid;
  gap: .75rem;
}

.gamedb-combination-card,
.gamedb-combination-panel {
  min-width: 0;
}

.gamedb-combination-card {
  padding: .8rem;
  border: 1px solid var(--gamedb-bg-light);
  border-radius: .35rem;
  background: var(--gamedb-bg);
}

.gamedb-combination-title {
  padding: 0;
  border: 0;
  background: none;
  color: var(--gamedb-gold);
  font: inherit;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
}

.gamedb-combination-description {
  margin: .45rem 0 .7rem;
  font-size: .72rem;
  opacity: .85;
}

.gamedb-combination-formula {
  display: flex;
  align-items: stretch;
  gap: .35rem;
  overflow-x: auto;
  padding: .25rem 0 .6rem;
}

.gamedb-combination-outcome {
  position: relative;
  flex: 0 0 auto;
}

.gamedb-combination-chance {
  position: absolute;
  right: .25rem;
  bottom: .1rem;
  padding: .05rem .22rem;
  color: var(--gamedb-gold);
  background: rgba(13, 17, 25, .9);
  border-radius: .15rem;
  font-size: .58rem;
}

.gamedb-combination-search {
  width: min(28rem, 100%);
  margin: 0 0 .75rem;
  padding: .45rem .6rem;
  color: #e8ecf4;
  background: var(--gamedb-bg);
  border: 1px solid var(--gamedb-bg-light);
  border-radius: .25rem;
}

.gamedb-combination-search:focus {
  border-color: var(--gamedb-gold);
  outline: none;
}

.gamedb-combination-item {
  display: flex;
  align-items: center;
  flex: 0 0 9.5rem;
  gap: .45rem;
  padding: .45rem;
  border: 1px solid var(--gamedb-bg-light);
  border-radius: .25rem;
  color: #e8ecf4;
  text-decoration: none;
}

.gamedb-combination-item:hover {
  border-color: var(--gamedb-gold);
}

.gamedb-combination-item img {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.gamedb-combination-item-text {
  display: flex;
  flex-direction: column;
  font-size: .66rem;
  line-height: 1.25;
}

.gamedb-combination-item-text small {
  color: var(--gamedb-gold);
  font-size: .68rem;
}

.gamedb-combination-operator {
  align-self: center;
  flex: 0 0 auto;
  color: var(--gamedb-gold);
  font-size: 1rem;
  font-weight: 700;
}

.gamedb-combination-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem 1rem;
  margin: .1rem 0 .55rem;
  font-size: .68rem;
}

.gamedb-combination-failure {
  color: #ef858b;
}

.gamedb-combination-panel table {
  width: auto;
  max-width: 100%;
  margin: .35rem 0;
  font-size: .68rem;
}

.gamedb-combination-panel table th,
.gamedb-combination-panel table td {
  width: auto;
  padding-right: 2rem;
  text-align: left;
  white-space: nowrap;
}

.gamedb-combination-panel table th:last-child,
.gamedb-combination-panel table td:last-child {
  padding-right: 0;
}

.gamedb-combination-guide {
  display: block;
  clear: both;
  width: max-content;
  max-width: 100%;
  margin: .55rem 0 0;
  font-size: .7rem;
  font-weight: 700;
}

.gamedb-tooltip.gamedb-tooltip-combination {
  width: min(70rem, 100%);
}

.gamedb-combination-weapons {
  margin-top: .8rem;
  padding-top: .2rem;
  border-top: 1px solid var(--gamedb-bg-light);
}

.gamedb-combination-weapon-list + .gamedb-combination-weapon-list {
  margin-top: 1rem;
  padding-top: .5rem;
  border-top: 1px solid rgba(143, 165, 188, .2);
}

.gamedb-combination-weapon-list .gamedb-filter-bar {
  margin-bottom: .45rem;
}

.gamedb-npc-inventory-table { width: 100%; border-collapse: collapse; }
.gamedb-npc-inventory-table th { text-align: left; color: var(--gamedb-muted); font-size: .72rem; }
.gamedb-npc-inventory-table th:last-child,
.gamedb-npc-inventory-price { text-align: right; white-space: nowrap; }
.gamedb-npc-inventory-link { display: flex; align-items: center; gap: .45rem; }
.gamedb-npc-inventory-link img { width: 28px; height: 28px; object-fit: contain; }
.gamedb-npc-inventory-section .gamedb-item-pagination { justify-content: center; margin-top: .55rem; }
.gamedb-npc-inventory-page-label { min-width: 3.5rem; text-align: center; color: var(--gamedb-muted); }
.gamedb-npc-shop {
  position: relative;
  width: 218px;
  height: 195px;
  margin: .35rem auto;
  background: url("/assets/gamedb/shop-items-window.png") no-repeat;
  image-rendering: auto;
  font-family: Arial, sans-serif;
}
.gamedb-npc-shop-slots {
  position: absolute;
  top: 13px;
  left: 16px;
  display: grid;
  grid-template-columns: repeat(5, 35px);
  grid-template-rows: repeat(4, 35px);
  gap: 3px;
}
.gamedb-npc-shop-slot {
  display: grid;
  place-items: center;
  width: 35px;
  height: 35px;
  padding: 2px;
  border: 0;
  background: transparent;
  box-sizing: border-box;
}
.gamedb-npc-shop-slot:not(.empty) { cursor: pointer; }
.gamedb-npc-shop-slot:not(.empty):hover,
.gamedb-npc-shop-slot:not(.empty):focus { background: rgba(214, 190, 104, .18); outline: 1px solid #bcae79; }
.gamedb-npc-shop-slot img { width: 30px; height: 30px; object-fit: contain; image-rendering: auto; }
.gamedb-npc-shop-pagination {
  position: absolute;
  left: 13px;
  right: 13px;
  top: 169px;
  height: 18px;
  display: grid;
  grid-template-columns: 1fr 58px 1fr;
  align-items: center;
}
.gamedb-npc-shop-page {
  height: 18px;
  padding: 0 4px;
  border: 0;
  color: #b7b7b7;
  background: transparent;
  font: 12px Arial, sans-serif;
  cursor: pointer;
}
.gamedb-npc-shop-page.previous { text-align: left; }
.gamedb-npc-shop-page.next { text-align: right; }
.gamedb-npc-shop-page:disabled { color: #666; cursor: default; }
.gamedb-npc-shop-page-label { color: #ddd; text-align: center; font: 13px Arial, sans-serif; }
.gamedb-shop-preview-price { margin-top: .55rem; color: #c8d8ed; font-size: .68rem; }
.gamedb-shop-preview-price-title { margin-bottom: .25rem; color: #91b5e4; }
.gamedb-shop-preview-price-row { display: flex; justify-content: flex-start; gap: .45rem; padding-left: .35rem; }
.gamedb-shop-preview-price-row strong { color: #e7e7e7; font-weight: 400; }
.gamedb-npc-card-map-svg { display: block; width: 100%; max-height: 28rem; background: #101722; }
.gamedb-npc-card-map-marker { filter: drop-shadow(0 0 3px #000); }
