/* Sits above the dock so shop / yard buttons stay tappable. */
.fw-statcard-root {
  position: fixed;
  inset: 0;
  z-index: 24;
  pointer-events: none;
}
.fw-statcard-root.hidden { display: none; }
.fw-statcard-root.open { display: block; }

.fw-statcard-backdrop {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: var(--dock-clear, 180px);
  pointer-events: auto;
  background: transparent;
}

.fw-statcard {
  position: absolute;
  left: 50%;
  bottom: calc(var(--dock-clear, 180px) + 8px);
  transform: translateX(-50%);
  width: min(520px, calc(100vw - 24px));
  max-height: min(220px, calc(100vh - var(--dock-clear, 180px) - 70px));
  overflow: auto;
  pointer-events: auto;
  background: rgba(20, 16, 12, 0.94);
  color: #f3e6d4;
  border: 1px solid #e8b84a;
  border-radius: 12px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
  padding: 10px 12px 12px;
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
}

.fw-statcard-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.fw-statcard-portrait {
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  border-radius: 8px;
  background: #1c1612;
  border: 1px solid #4a382c;
}

.fw-statcard-ident { flex: 1 1 auto; min-width: 0; }
.fw-statcard-name {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.15;
}
.fw-statcard-cost {
  font-size: 0.78rem;
  color: #d7b07a;
  margin-top: 2px;
}

.fw-statcard-close {
  flex: 0 0 auto;
  min-width: 44px;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid #5a4634;
  background: #2a221c;
  color: #f3e6d4;
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
}

.fw-statcard-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px 8px;
}

.fw-statcard-cell .k {
  display: block;
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #d7b07a;
}
.fw-statcard-cell .v {
  display: block;
  font-size: 0.82rem;
  line-height: 1.2;
}

.fw-statcard-special {
  margin: 8px 0 0;
  font-size: 0.78rem;
  line-height: 1.35;
  color: #e8d7c0;
}

@media (max-width: 700px), (max-height: 700px) {
  .fw-statcard { max-height: 190px; padding: 8px 10px; }
  .fw-statcard-grid { grid-template-columns: repeat(4, 1fr); gap: 4px 6px; }
  .fw-statcard-name { font-size: 0.95rem; }
}

@media (orientation: landscape) and (max-height: 768px) {
  .fw-statcard {
    max-height: 188px;
  }
}
