/* --- In-game style view ------------------------------------------------------- */

.breeding-game {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.8fr) minmax(0, 1.15fr);
  gap: 1.5rem;
  align-items: center;
  margin: 0 auto 0.75rem;
}

.breeding-game-parents,
.breeding-game-child {
  display: grid;
  gap: 0.7rem;
  align-content: center;
}

.game-pal {
  min-width: 0;
}

.game-pal-frame {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.55rem 0.75rem;
  background: linear-gradient(165deg, rgba(19, 48, 59, 0.9), rgba(7, 20, 27, 0.95));
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}

.game-pal-frame::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 2px;
  background: var(--pal-hover-border, var(--cyan));
  opacity: 0.85;
}

.game-pal-portrait {
  flex: none;
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  margin-left: 0.15rem;
}

.game-pal-portrait img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 6px 8px rgba(0, 0, 0, 0.45));
}

.game-pal-copy {
  display: grid;
  gap: 0.14rem;
  min-width: 0;
  flex: 1 1 auto;
}

.game-pal-level {
  color: var(--cyan);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.game-pal-name {
  font-size: 1.02rem;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.game-pal-name small {
  color: var(--muted);
  font-size: 0.7em;
  font-weight: 500;
}

.game-pal-hp {
  position: relative;
  display: block;
  height: 0.85rem;
  margin-top: 0.15rem;
  background: rgba(4, 14, 10, 0.85);
  border: 1px solid rgba(120, 220, 150, 0.35);
  border-radius: 4px;
  overflow: hidden;
}

.game-pal-hp i {
  position: absolute;
  inset: 1px;
  background: linear-gradient(90deg, #2f9e5f, #57d383);
  border-radius: 3px;
}

.game-pal-hp b {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #eafff1;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
}

.game-pal-hp b small {
  opacity: 0.75;
}

.game-pal-gender {
  flex: none;
  font-size: 1.5rem;
  line-height: 1;
  filter: drop-shadow(0 0 8px rgba(0, 0, 0, 0.6));
}

.game-pal-gender--male { color: #5ec2ff; }
.game-pal-gender--female { color: #ff8ad9; }
.game-pal-gender--unknown { color: var(--muted); font-size: 1.05rem; }

.game-pal-empty {
  display: grid;
  place-items: center;
  min-height: 76px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  color: var(--muted);
  font-size: 0.85rem;
}

/* --- Searchable game cards ---------------------------------------------------- */

.game-card-search {
  position: relative;
  isolation: isolate;
  overflow: visible;
  content-visibility: visible;
  contain-intrinsic-size: none;
}

.breeding-game .breeding-game-card.game-card-search {
  content-visibility: visible;
  contain-intrinsic-size: none;
}

.game-card-search--static .paldeck-card-name {
  color: var(--muted);
}

.breeding-game-parents .game-pal,
.breeding-game-child .game-pal {
  position: relative;
  margin-bottom: 0;
}

/* La carta en edición eleva todo su contexto para que el desplegable de
   resultados no quede por debajo de la otra carta de padre. */
.breeding-game-parents .game-pal:focus-within,
.breeding-game-parents .game-pal:has(.game-card-results:not([hidden])) {
  z-index: 80;
}

.game-card-filled { position: relative; min-width: 0; }
.game-card-actions {
  position: absolute; z-index: 12;
  top: 50%; right: calc(100% + 0.25rem);
  transform: translateY(-50%);
  display: grid; gap: 0.16rem; padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.game-card-action {
  appearance: none;
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  color: #aec8cf;
  font: inherit;
  font-size: 1.1rem;
  line-height: 1;
  background: rgba(3, 18, 25, 0.72);
  border: 1px solid rgba(113, 188, 202, 0.24);
  border-radius: 4px;
  box-shadow: inset 0 1px rgba(210, 251, 255, 0.06);
  cursor: pointer;
  transition: color 150ms ease, border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.game-card-action:hover,
.game-card-action:focus-visible {
  color: #efffff;
  border-color: var(--cyan);
  box-shadow: 0 0 0 2px rgba(98, 231, 237, 0.22), 0 6px 14px rgba(0, 0, 0, 0.52);
  outline: none;
  transform: translateX(-1px);
}

.game-card-action--edit { color: #d8f8fb; }
.game-card-action--male { color: #79ccff; }
.game-card-action--female { color: #f19cda; }
.game-card-results[hidden] {
  display: none;
}

/* --- Heart between parents ---------------------------------------------------- */

.breeding-game-parents {
  position: relative;
  display: flex;
  flex-direction: column;
  align-self: start;
  justify-content: flex-start;
  gap: 0.75rem;
  box-sizing: border-box;
  padding: 0.8rem 0 0 2.55rem;
}

.breeding-game-parents .game-pal + .game-pal {
  margin-top: 1.35rem;
}

.breeding-game-child { align-self: start; padding-top: 4.85rem; }

.game-heart {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  width: 2.6rem;
  height: 2.6rem;
  z-index: 5;
  background: radial-gradient(circle at 35% 30%, #ff7a9e, #e0244e 70%);
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  box-shadow: 0 0 16px rgba(255, 80, 130, 0.55);
}

.game-heart img {
  width: 1.25rem;
  height: 1.25rem;
  filter: brightness(0) invert(1);
}

.breeding-game-center {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 0.4rem;
  position: relative;
}

.game-chevrons {
  display: inline-flex;
  gap: 0.28rem;
  user-select: none;
}

.game-chevrons i {
  width: 0.72rem;
  height: 0.72rem;
  border-top: 0.22rem solid var(--cyan);
  border-right: 0.22rem solid var(--cyan);
  transform: rotate(45deg);
  border-radius: 0.12rem;
  filter: drop-shadow(0 0 6px rgba(98, 231, 237, 0.8));
  animation: game-chevron-pulse 1.6s ease-in-out infinite;
}

.game-chevrons i:nth-child(1) { opacity: 0.35; animation-delay: 0s; }
.game-chevrons i:nth-child(2) { opacity: 0.65; animation-delay: 0.2s; }
.game-chevrons i:nth-child(3) { opacity: 1; animation-delay: 0.4s; }

@keyframes game-chevron-pulse {
  0%, 100% { transform: rotate(45deg) translate(0, 0); filter: drop-shadow(0 0 3px rgba(98, 231, 237, 0.45)); }
  50% { transform: rotate(45deg) translate(1px, -1px); filter: drop-shadow(0 0 9px rgba(98, 231, 237, 0.95)); }
}

.breeding-game-center .game-chevrons {
  position: absolute;
  top: 8rem;
}

.breeding-game-center .game-chevrons:not(.game-chevrons--right) {
  left: -0.15rem;
}

.game-chevrons--right {
  right: -0.15rem;
}

.game-egg {
  display: grid;
  place-items: center;
  padding: 0.35rem 0;
}

.game-result-meta {
  display: contents;
}

.incubator-stage {
  width: 190px;
  height: 258px;
  display: grid;
  place-items: center;
  filter: drop-shadow(0 16px 22px rgba(0, 0, 0, 0.45));
}

.incubator-stage canvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
  touch-action: none;
}

.incubator-stage canvas:active {
  cursor: grabbing;
}

.game-egg-shell {
  width: 148px;
  height: 178px;
  box-shadow:
    0 0 42px rgba(98, 231, 237, 0.22),
    0 22px 38px rgba(0, 0, 0, 0.4);
}

.game-egg-shell.is-empty {
  opacity: 0.3;
  filter: grayscale(0.85);
}

.game-odds {
  margin: 0.28rem 0 0;
  display: flex;
  gap: 0.4rem;
  font-size: 0.8rem; line-height: 1.1;
  font-weight: 700;
}

.game-odds-male { color: #8ed4ff; }
.game-odds-female { color: #f0a3dd; }
.game-odds-sep { color: var(--muted); }

.game-egg-name {
  min-height: 1em;
  margin: 0.2rem 0 0;
  color: #dffcff;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.025em;
  text-align: center;
  text-shadow: 0 0 16px rgba(91, 229, 240, 0.42);
}

/* --- Calculator layout -------------------------------------------------------- */

.breeding-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
  align-items: stretch;
  margin-bottom: 1.25rem;
}

.breeding-panel {
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 1.1rem 1.15rem 1.25rem;
  box-shadow: var(--shadow-deep);
  display: flex;
  flex-direction: column;
}

.breeding-panel > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.breeding-panel h2 {
  margin: 0;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
}

.breeding-panel-kicker {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
}

