/* One tooltip surface for navigation, resources, upgrades, and dialog actions. */
.game-tooltip {
  position: fixed;
  z-index: 10000;
  width: max-content;
  max-width: min(288px, calc(100vw - 24px));
  padding: 12px 14px;
  border: 1px solid #b29b68;
  border-radius: 7px;
  background: linear-gradient(145deg, #345247, #233c33);
  color: #f3eedb;
  box-shadow: 0 6px 22px #13281e36, inset 0 1px 0 #fff8d914;
  font-family: inherit;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.65;
  text-align: left;
  letter-spacing: 0;
  overflow-wrap: anywhere;
  pointer-events: none;
  isolation: isolate;
  animation: game-tooltip-in 120ms ease-out;
}

.game-tooltip[hidden] { display: none !important; }

/* Shop hints follow the reference's icon/name/price header and separated detail sections. */
.game-tooltip.store-tooltip {
  width: 360px;
  padding: 0;
  border: 2px solid #ac9462;
  border-radius: 2px;
  background: linear-gradient(135deg, #304c40, #1f342b);
  box-shadow: 0 5px 18px #10241d59, inset 0 0 0 1px #fff1bf20;
}
.store-tooltip-content { padding: 12px; }
.store-tooltip-content[hidden], .game-tooltip-content[hidden], .game-tooltip-title[hidden] { display: none; }
.store-tooltip-header { display: grid; grid-template-columns: 48px minmax(0,1fr); gap: 4px 10px; align-items: start; }
.store-tooltip-art { grid-row: 1 / 3; width: 48px; height: 48px; align-self: center; }
.store-tooltip-art > .icon, .store-tooltip-art .machine-art, .store-tooltip-art img { width: 48px; height: 48px; display: block; object-fit: contain; }
.store-tooltip-title { color: #fff1cc; font-size: 17px; font-weight: 700; line-height: 1.3; }
.store-tooltip-tag { display: block; margin-top: 3px; color: #c9d5bc; font-size: 11px; }
.store-tooltip-price { grid-column: 2; display: flex; align-items: baseline; justify-content: space-between; gap: 8px; text-align: right; }
.store-tooltip-price-label { color: #c9d5bc; font-size: 11px; }
.store-tooltip-price-amount { color: #d9edb0; font-size: 16px; font-variant-numeric: tabular-nums; }
.store-tooltip[data-available='false'] .store-tooltip-price-amount { color: #e9bba5; }
.store-tooltip-description { margin: 10px 0 0; padding: 10px 0 0; border-top: 1px solid #b8a47566; color: #f0ecd8; line-height: 1.65; }
.store-tooltip-stats { display: grid; gap: 5px; margin: 10px 0 0; padding-top: 9px; border-top: 1px solid #b8a47540; }
.store-tooltip-stat { display: grid; grid-template-columns: minmax(0,.9fr) minmax(0,1.1fr); gap: 12px; }
.store-tooltip-stat dt { color: #bdcbb6; }
.store-tooltip-stat dd { margin: 0; color: #fff3d2; font-weight: 650; text-align: right; font-variant-numeric: tabular-nums; }
.store-tooltip-note { margin: 9px 0 0; color: #bdcbb6; font-size: 11px; line-height: 1.55; }
.store-tooltip-status { margin: 10px -12px -12px; padding: 8px 12px; border-top: 1px solid #b8a47555; background: #10271c44; color: #d9edb0; line-height: 1.6; }
.store-tooltip[data-available='false'] .store-tooltip-status { color: #edc7b0; }
.game-tooltip[data-placement='left']::before, .game-tooltip[data-placement='left']::after { display: none; }

@media(min-width:700px) {
  .store-tooltip-header { grid-template-columns: 48px minmax(0,1fr) auto; gap: 10px; }
  .store-tooltip-art { grid-row: 1; }
  .store-tooltip-price { grid-column: 3; flex-direction: column; gap: 1px; align-items: flex-end; }
}

.game-tooltip-title {
  color: #fff1c7;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.45;
}

.game-tooltip-content {
  color: #e3e6d8;
  font-size: 12px;
  line-height: 1.65;
  white-space: pre-line;
}

.game-tooltip-title:not(:empty) + .game-tooltip-content:not(:empty) {
  margin-top: 7px;
  padding-top: 7px;
  border-top: 1px solid #a6b09635;
}

.game-tooltip-title:empty,
.game-tooltip-content:empty { display: none; }

.game-tooltip::before,
.game-tooltip::after {
  content: '';
  position: absolute;
  left: clamp(12px, var(--tooltip-arrow-x, 50%), calc(100% - 12px));
  width: 0;
  height: 0;
  border: 6px solid transparent;
  transform: translateX(-50%);
}

.game-tooltip[data-placement='top']::before {
  top: 100%;
  border-top-color: #b29b68;
}

.game-tooltip[data-placement='top']::after {
  top: calc(100% - 1px);
  border-top-color: #233c33;
}

.game-tooltip[data-placement='bottom']::before {
  bottom: 100%;
  border-bottom-color: #b29b68;
}

.game-tooltip[data-placement='bottom']::after {
  bottom: calc(100% - 1px);
  border-bottom-color: #345247;
}

@keyframes game-tooltip-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .game-tooltip { animation: none; }
}
