/* Hearts Zelda, status card, moves bar, radar, status, quest under map */

#player-hearts-hud,
.player-hearts-hud {
  pointer-events: none;
  margin-top: 2px;
}

.player-hearts-hud.is-menu-hidden {
  opacity: 0;
}

.heart-meter__row {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  max-width: 220px;
}

.heart {
  width: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.35));
}

.heart__svg {
  width: 26px;
  height: 26px;
  display: block;
}

.heart__outline {
  fill: #3a1515;
}

.heart__fill {
  fill: #3a1515;
}

.heart--full .heart__fill {
  fill: #e53935;
}

.heart--3q .heart__fill {
  fill: url(#none);
  fill: #e53935;
  clip-path: inset(0 25% 0 0);
}

.heart--half .heart__fill {
  fill: #e53935;
  clip-path: inset(0 50% 0 0);
}

.heart--1q .heart__fill {
  fill: #e53935;
  clip-path: inset(0 75% 0 0);
}

.heart--empty .heart__fill {
  fill: #5c3030;
  opacity: 0.35;
}

.player-hearts-hud.is-low .heart--full .heart__fill,
.player-hearts-hud.is-low .heart--3q .heart__fill,
.player-hearts-hud.is-low .heart--half .heart__fill,
.player-hearts-hud.is-low .heart--1q .heart__fill {
  fill: #ff7043;
}

.party-slot.is-ride {
  box-shadow: 0 0 0 2px #22c55e;
}

#party-combat-detail {
  position: absolute;
  z-index: 8;
  left: calc(var(--hud-safe-left) + var(--party-slot, 52px) + 10px);
  bottom: var(--hud-safe-bottom);
  width: min(300px, 38vw);
  pointer-events: none;
}

.party-combat__detail {
  pointer-events: auto;
  padding: 10px 12px 8px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255, 254, 248, 0.96), rgba(243, 239, 230, 0.94));
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22), inset 0 0 0 1px rgba(40, 32, 24, 0.12);
  color: #2c261c;
  font: 600 12px/1.3 "Segoe UI", system-ui, sans-serif;
  animation: party-combat-in 180ms ease-out;
}

@keyframes party-combat-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.party-combat__head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.party-combat__face {
  width: 48px;
  height: 48px;
  object-fit: contain;
  border-radius: 10px;
  background: rgba(40, 32, 24, 0.06);
  flex: 0 0 auto;
}

.party-combat__face--fallback {
  display: grid;
  place-items: center;
  font-size: 18px;
}

.party-combat__meta {
  flex: 1;
  min-width: 0;
}

.party-combat__title-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.party-combat__name {
  font-size: 14px;
}

.party-combat__gender {
  color: #3b82f6;
  font-size: 13px;
}

.party-combat__lv {
  opacity: 0.7;
  font-size: 12px;
  margin-left: auto;
}

.party-combat__bar-tag {
  width: 28px;
  flex: 0 0 auto;
  font-size: 10px;
  opacity: 0.65;
  letter-spacing: 0.02em;
}

.party-combat__hp-wrap,
.party-combat__exp-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.party-combat__hp,
.party-combat__exp {
  flex: 1;
  height: 8px;
  border-radius: 999px;
  background: rgba(40, 32, 24, 0.12);
  overflow: hidden;
}

.party-combat__hp i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #4ade80, #16a34a);
  border-radius: inherit;
}

.party-combat__exp i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #60a5fa, #2563eb);
  border-radius: inherit;
}

.party-combat__hp-num {
  font-variant-numeric: tabular-nums;
  font-size: 11px;
  min-width: 3.5em;
  text-align: right;
}

.party-combat__actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
}

.party-combat__mode {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid rgba(40, 32, 24, 0.14);
  border-radius: 999px;
  color: #2c261c;
  background: rgba(40, 32, 24, 0.08);
  cursor: pointer;
}

.party-combat__mode:hover,
.party-combat__mode.is-picker-open {
  background: rgba(40, 32, 24, 0.16);
}

.party-combat__mode-glyph {
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
}

.party-combat__mode-glyph svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 1.6;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.party-combat__action {
  flex: 1;
  border: 0;
  border-radius: 999px;
  padding: 5px 8px;
  cursor: pointer;
  font: 700 11px/1 "Segoe UI", system-ui, sans-serif;
  color: #2c261c;
  background: rgba(40, 32, 24, 0.08);
}

.party-combat__action:hover:not(:disabled) {
  background: rgba(40, 32, 24, 0.14);
}

.party-combat__action:disabled {
  opacity: 0.4;
  cursor: default;
}

.party-combat__action--ride.is-on {
  background: linear-gradient(180deg, #86efac, #22c55e);
  color: #052e16;
}

/* Bottom-center moves Z/X/C/V */
.party-moves-combat {
  position: absolute;
  z-index: 8;
  left: 50%;
  bottom: calc(var(--hud-safe-bottom) + 4px);
  transform: translateX(-50%);
  pointer-events: none;
}

/* Tip bem acima da barra de golpes (sem sobrepor) */
.jogo-hud:has(.party-moves-combat:not([hidden])) .jogo-prompt {
  bottom: max(148px, calc(var(--hud-safe-bottom, 12px) + 132px));
}

.party-moves-combat {
  z-index: 9;
}

.party-moves-combat[hidden] {
  display: none !important;
}

/* Stack de toasts no topo do dock do minimap (direita) */
.hud-toast-stack {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  width: var(--area-minimap-size, 220px);
  max-width: 100%;
  pointer-events: none;
  z-index: 4;
}

.hud-toast-stack .jogo-toast[hidden] {
  display: none !important;
}

.hud-toast-stack .item-obtain-toast {
  width: 100%;
  max-width: none;
  min-width: 0;
}

.party-moves-combat__inner {
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 8px 14px 10px;
  border-radius: 999px;
  background: rgba(12, 16, 24, 0.72);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35), inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(6px);
}

.party-moves-combat__slots {
  display: flex;
  align-items: center;
  gap: 8px;
}

.skill-chip {
  position: relative;
  width: 58px;
  height: 58px;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  color: #f8fafc;
  background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.18), rgba(30, 41, 59, 0.95));
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.12), 0 2px 8px rgba(0, 0, 0, 0.35);
  display: grid;
  place-items: center;
  padding: 4px;
  overflow: visible;
}

.skill-chip[data-move-slot="2"],
.skill-chip[data-move-slot="3"] {
  width: 46px;
  height: 46px;
}

.skill-chip.is-ready {
  box-shadow:
    inset 0 0 0 2px color-mix(in srgb, var(--chip-tipo, #94a3b8) 70%, white),
    0 2px 10px rgba(0, 0, 0, 0.4);
}

.skill-chip.is-empty {
  opacity: 0.45;
  cursor: default;
}

.skill-chip__key {
  position: absolute;
  top: -2px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  font: 700 9px/1 "Segoe UI", system-ui, sans-serif;
  padding: 2px 5px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  color: #e2e8f0;
}

.skill-chip__art {
  position: absolute;
  inset: 10px;
  z-index: 1;
  display: grid;
  place-items: center;
  pointer-events: none;
}

.skill-chip__art[hidden] {
  display: none !important;
}

.skill-chip__art img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.45));
}

.skill-chip__type {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.35));
}

.skill-chip__type .type-shield-icon {
  display: block;
}

.skill-chip.has-skill-art .skill-chip__type {
  inset: auto;
  right: -2px;
  bottom: -2px;
  width: 18px;
  height: 18px;
  z-index: 2;
}

.skill-chip.has-skill-art .skill-chip__kind {
  opacity: 0;
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.skill-chip__kind {
  position: relative;
  z-index: 2;
  font: 700 9px/1.1 "Segoe UI", system-ui, sans-serif;
  text-align: center;
  max-width: 48px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  margin-top: 10px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.65);
}

/* Escudos elementais (shared) */
.type-icon {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
  border-radius: 4px;
  min-width: 22px;
  min-height: 22px;
}

.type-icon::before {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: 50%;
  background: var(--type, #64748b);
  opacity: 0.85;
  z-index: 0;
}

.type-icon.is-loaded::before {
  display: none;
}

.type-shield-icon {
  position: relative;
  z-index: 1;
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.pokedex-detail__type {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.pokedex-detail__type-label {
  font: 650 12px/1 "Segoe UI", system-ui, sans-serif;
  color: var(--type, #e2e8f0);
}

.party-moves-combat__pp {
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(220px, 70vw);
}

.party-moves-combat__pp-bar {
  flex: 1;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.party-moves-combat__pp-bar i {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #fb923c, #ea580c);
  border-radius: inherit;
}

.party-moves-combat__pp-num {
  font: 700 10px/1 "Segoe UI", system-ui, sans-serif;
  color: #fdba74;
  font-variant-numeric: tabular-nums;
  min-width: 4.5em;
}

/* Radar */
.poke-radar {
  min-width: 200px;
  max-width: 260px;
  padding: 8px 10px 10px;
  border-radius: 14px;
  background: linear-gradient(180deg, #1a2330, #0f1620);
  color: #e8eef7;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35), inset 0 0 0 1px rgba(120, 180, 255, 0.2);
  pointer-events: auto;
}

.poke-radar__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.poke-radar__close {
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 18px;
  cursor: pointer;
  opacity: 0.7;
}

.poke-radar__area {
  margin: 0 0 6px;
  font-size: 11px;
  opacity: 0.75;
}

.poke-radar__list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  max-height: 220px;
  overflow: auto;
}

.poke-radar__card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 4px;
  border: 0;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: inherit;
  cursor: pointer;
}

.poke-radar__face {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
}

.poke-radar__face img {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.poke-radar__face.is-sil {
  filter: brightness(0);
  opacity: 0.55;
}

.poke-radar__name {
  font-size: 10px;
  text-align: center;
}

.poke-radar__st {
  font-size: 9px;
  text-transform: uppercase;
  opacity: 0.55;
}

/* Status jogador */
#player-status-hud {
  position: absolute;
  z-index: 40;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -48%);
  width: min(360px, 92vw);
  pointer-events: none;
}

#player-status-hud[hidden] {
  display: none !important;
}

.player-status {
  pointer-events: auto;
  padding: 14px 16px;
  border-radius: 16px;
  background: linear-gradient(180deg, #fffef8, #efe9dc);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
  color: #2c261c;
  opacity: 0;
  transform: scale(0.96);
  transition: opacity 160ms ease, transform 160ms ease;
}

#player-status-hud.is-open .player-status,
.player-status-hud.is-open .player-status {
  opacity: 1;
  transform: none;
}

#player-status-hud.is-open {
  /* host também ganha is-open */
}

.player-status__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.player-status__close {
  border: 0;
  background: transparent;
  font-size: 20px;
  cursor: pointer;
}

.player-status__facts {
  display: grid;
  gap: 8px;
  margin: 0;
}

.player-status__facts > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px solid rgba(40, 32, 24, 0.08);
}

.player-status__facts dt {
  opacity: 0.65;
}

.player-status__facts dd {
  margin: 0;
  font-weight: 700;
}

/* Quest objective — sob o minimap */
.hud-map-dock .quest-objective-hud,
#quest-objective-hud.quest-objective-hud {
  position: relative;
  z-index: 1;
  left: auto;
  top: auto;
  width: var(--area-minimap-size, 220px);
  max-width: 100%;
  pointer-events: none;
  margin-top: 2px;
}

.quest-objective {
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(12, 16, 24, 0.78);
  color: #fde68a;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
  font: 600 11px/1.35 "Segoe UI", system-ui, sans-serif;
  text-align: center;
}

.quest-objective__text {
  display: block;
  opacity: 0.95;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Game menu shell layout (além do extract) */
.game-menu {
  position: absolute;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 160ms ease;
}

.game-menu[hidden] {
  display: none !important;
}

.game-menu.is-open {
  opacity: 1;
  pointer-events: auto;
}

.game-menu__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 12, 20, 0.45);
  backdrop-filter: blur(2px);
}

.game-menu__panel {
  position: relative;
  z-index: 1;
  width: min(920px, 94vw);
  height: min(620px, 86vh);
  display: flex;
  flex-direction: column;
  border-radius: 18px;
  background: linear-gradient(180deg, #f7f3ea 0%, #ebe4d6 100%);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.4);
  color: #2c261c;
  overflow: hidden;
}

.game-menu__top {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(40, 32, 24, 0.1);
  background: rgba(255, 255, 255, 0.35);
}

.game-menu__money {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
}

.game-menu__money-icon {
  width: 22px;
  height: 22px;
}

.game-menu__tabs {
  display: flex;
  flex: 1;
  gap: 4px;
  justify-content: center;
}

.game-menu__tab,
.game-menu__system-tab {
  border: 0;
  background: transparent;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  font: 700 13px/1 system-ui, sans-serif;
  color: #3a3328;
}

.game-menu__tab.is-active,
.game-menu__system-tab.is-active {
  background: #2c261c;
  color: #f7f3ea;
}

.game-menu__close {
  border: 0;
  background: rgba(40, 32, 24, 0.08);
  width: 32px;
  height: 32px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 18px;
}

.game-menu__system-rail {
  display: flex;
  gap: 4px;
  padding: 8px 14px;
  border-bottom: 1px solid rgba(40, 32, 24, 0.08);
}

.game-menu__pages {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 14px 16px 18px;
}

.game-menu__page {
  min-height: 100%;
}

.game-menu__page[hidden] {
  display: none !important;
}

.menu-page-host {
  display: grid;
  gap: 10px;
}

.menu-page-host .jogo-grade,
.menu-page-host .jogo-item {
  /* reusa estilos de jogo.css */
}

body.game-menu-open .hud-item-dock,
body.game-menu-open .hud-party,
body.game-menu-open #party-combat-detail,
body.game-menu-open .party-moves-combat,
body.game-menu-open .hud-map-dock {
  opacity: 0.15;
  pointer-events: none;
}

body.game-menu-open .hud-utility-dock {
  opacity: 0.35;
}

/* Skill loadout placeholder */
.skill-loadout-hud {
  position: absolute;
  inset: 0;
  z-index: 45;
  display: grid;
  place-items: center;
  background: rgba(8, 12, 20, 0.4);
  pointer-events: auto;
}

.skill-loadout-hud[hidden] {
  display: none !important;
}

.skill-loadout-hud__panel {
  width: min(420px, 92vw);
  padding: 16px 18px;
  border-radius: 16px;
  background: linear-gradient(180deg, #fffef8, #ebe4d6);
  color: #2c261c;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
}

.skill-loadout-hud__panel header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.skill-loadout-hud__panel header button {
  border: 0;
  background: transparent;
  font-size: 20px;
  cursor: pointer;
}

.skill-loadout-hud__nota {
  margin: 0;
  opacity: 0.8;
  font: 500 13px/1.4 system-ui, sans-serif;
}

@media (prefers-reduced-motion: reduce) {
  .party-combat__detail,
  .game-menu,
  .player-status {
    transition: none !important;
    animation: none !important;
  }
}
