/* Short match result overlay → return to map */
.chess-result-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 8, 4, 0.82);
  backdrop-filter: blur(4px);
  animation: chess-result-in 0.28s ease;
  font-family: "Courier New", Courier, monospace;
  color: #cfe;
}
@keyframes chess-result-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
.chess-result-card {
  width: min(420px, 92vw);
  padding: 28px 24px 22px;
  border-radius: 12px;
  border: 1px solid rgba(0, 255, 136, 0.45);
  background: rgba(0, 16, 8, 0.96);
  box-shadow: 0 0 40px rgba(0, 255, 136, 0.18);
  text-align: center;
}
.chess-result-overlay.is-win .chess-result-card {
  border-color: rgba(0, 255, 100, 0.7);
  box-shadow: 0 0 48px rgba(0, 255, 100, 0.28);
}
.chess-result-overlay.is-loss .chess-result-card,
.chess-result-overlay.is-resign .chess-result-card {
  border-color: rgba(255, 90, 90, 0.55);
  box-shadow: 0 0 36px rgba(255, 60, 60, 0.2);
}
.chess-result-overlay.is-draw .chess-result-card {
  border-color: rgba(224, 192, 96, 0.5);
}
.chess-result-kicker {
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  opacity: 0.65;
  margin-bottom: 8px;
  color: #09f530;
}
.chess-result-title {
  margin: 0 0 10px;
  font-size: 2rem;
  letter-spacing: 0.12em;
  color: #09f530;
  text-shadow: 0 0 18px rgba(0, 255, 100, 0.45);
}
.chess-result-overlay.is-loss .chess-result-title,
.chess-result-overlay.is-resign .chess-result-title {
  color: #ff7a7a;
  text-shadow: 0 0 16px rgba(255, 80, 80, 0.4);
}
.chess-result-overlay.is-draw .chess-result-title {
  color: #e0c060;
  text-shadow: 0 0 14px rgba(224, 192, 96, 0.35);
}
.chess-result-msg {
  margin: 0 0 12px;
  font-size: 0.95rem;
  line-height: 1.4;
  opacity: 0.9;
}
.chess-result-rewards {
  margin: 0 0 10px;
  font-size: 1.05rem;
  font-weight: 700;
  color: #e0c060;
  letter-spacing: 0.04em;
}
.chess-result-hint {
  margin: 14px 0 0;
  font-size: 0.75rem;
  opacity: 0.6;
  letter-spacing: 0.06em;
}
.chess-result-btn {
  appearance: none;
  margin-top: 14px;
  padding: 12px 22px;
  border: none;
  border-radius: 8px;
  background: #629924;
  color: #fff;
  font: inherit;
  font-weight: 800;
  letter-spacing: 0.06em;
  cursor: pointer;
}
.chess-result-btn:hover {
  filter: brightness(1.08);
}

/* New game | Quit row (resign / battle end) */
.chess-result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 16px;
}
.chess-result-actions .chess-result-btn {
  margin-top: 0;
  min-width: 7.5rem;
  flex: 1 1 auto;
  max-width: 11rem;
}
.chess-result-btn--primary {
  background: #629924;
  color: #fff;
}
.chess-result-btn--ghost {
  background: transparent;
  color: #cfe;
  border: 1px solid rgba(0, 255, 136, 0.35);
  box-shadow: none;
}
.chess-result-btn--ghost:hover {
  border-color: rgba(0, 255, 136, 0.65);
  background: rgba(0, 255, 136, 0.08);
  filter: none;
}
.chess-result-overlay.is-loss .chess-result-btn--primary {
  background: #8a3030;
}
.chess-result-overlay.is-loss .chess-result-btn--primary:hover {
  filter: brightness(1.1);
}

/* Floating XP over map player */
.forge-xp-float {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -120%);
  z-index: 40;
  pointer-events: none;
  font-family: "Courier New", Courier, monospace;
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: 0.06em;
  text-shadow: 0 0 12px rgba(0, 0, 0, 0.9), 0 0 18px rgba(0, 255, 100, 0.5);
  animation: forge-xp-rise 1.8s ease forwards;
  white-space: nowrap;
}
.forge-xp-float.is-gain {
  color: #09f530;
}
.forge-xp-float.is-loss {
  color: #ff7a7a;
  text-shadow: 0 0 12px rgba(0, 0, 0, 0.9), 0 0 16px rgba(255, 80, 80, 0.45);
}
@keyframes forge-xp-rise {
  0% {
    opacity: 0;
    transform: translate(-50%, -40%);
  }
  15% {
    opacity: 1;
  }
  70% {
    opacity: 1;
    transform: translate(-50%, -180%);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -220%);
  }
}
