/* ==========================================================================
   11-chess.css — Frostline Chess Overlay & Chat Bridge Styles
   Matches Sorry Kitty platform aesthetic: sleek, minimal, premium.
   ========================================================================== */

/* ── Menu Game Card Theme (Icon + Badge) ────────────────────────────────── */
.moment-game-card--chess {
  border-color: rgba(212, 144, 15, 0.25);
}
.moment-game-card--chess:hover {
  background: rgba(212, 144, 15, 0.08);
  border-color: rgba(212, 144, 15, 0.5);
}
.chess-icon {
  background: linear-gradient(135deg, rgba(212, 144, 15, 0.15), rgba(106, 135, 166, 0.2));
  color: #d4900f;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Dedicated Challenge Card Zone in Chat ───────────────────────────────── */
.chess-challenge-zone {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 90%;
  max-width: 320px;
  pointer-events: auto;
}

.chess-challenge-zone:empty {
  display: none !important;
  pointer-events: none !important;
}

.chess-challenge-card {
  position: relative;
  background: #ffffff;
  border: 1.5px solid rgba(212, 144, 15, 0.45);
  border-radius: 18px;
  padding: 20px 18px 16px;
  text-align: center;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.15), 0 0 24px rgba(212, 144, 15, 0.12);
  max-width: 300px;
  width: 100%;
  color: #18212f;
  animation: chessCardIn 0.22s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.chess-challenge-card.exiting {
  animation: chessCardOut 0.18s ease-in forwards;
}

@keyframes chessCardIn {
  from { opacity: 0; transform: scale(0.9) translateY(10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes chessCardOut {
  to   { opacity: 0; transform: scale(0.92) translateY(6px); }
}

.chess-chal-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #d4900f;
  background: rgba(212, 144, 15, 0.12);
  padding: 3px 10px;
  border-radius: 20px;
  margin-bottom: 8px;
}

.chess-chal-title {
  font-size: 15px;
  font-weight: 700;
  color: #18212f;
  margin-bottom: 4px;
  line-height: 1.3;
}

.chess-chal-sub {
  font-size: 12px;
  color: #5f6e86;
  margin-bottom: 14px;
}

.chess-chal-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.chess-chal-btn {
  flex: 1;
  padding: 9px 12px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: transform 0.12s ease, opacity 0.12s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.chess-chal-btn:active {
  transform: scale(0.96);
}

.chess-chal-accept {
  background: #d4900f;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(212, 144, 15, 0.35);
}

.chess-chal-decline {
  background: #eaeff5;
  color: #5f6e86;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

/* ── Fullscreen / Overlay Modal for Frostline Chess ──────────────────────── */
#chess-overlay {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  z-index: 500 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: env(safe-area-inset-top, 6px) 6px env(safe-area-inset-bottom, 6px);
  visibility: hidden;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.22s ease, visibility 0.22s ease;
  -webkit-tap-highlight-color: transparent;
  box-sizing: border-box;
}

#chess-overlay.is-open {
  visibility: visible;
  pointer-events: auto;
  opacity: 1;
}

.chess-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(14, 20, 30, 0.72);
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: auto;
}

#chess-overlay.is-open .chess-backdrop {
  opacity: 1;
}

.chess-card {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: min(100%, 540px);
  height: 98%;
  max-height: 840px;
  overflow: hidden !important;
  border-radius: 18px;
  background: #eaeff5;
  border: 1.5px solid rgba(212, 144, 15, 0.4);
  box-shadow: 0 20px 60px -10px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  transform: translateY(12px) scale(0.98);
  opacity: 0;
  transition: transform 0.22s cubic-bezier(0.2, 0.9, 0.3, 1), opacity 0.2s ease;
}

#chess-overlay.is-open .chess-card {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.chess-iframe {
  width: 100%;
  height: 100%;
  border: none;
  flex: 1;
  background: #eaeff5;
  display: block;
}

.chess-close-btn {
  position: absolute;
  top: 10px;
  right: 12px;
  z-index: 10;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(0, 0, 0, 0.1);
  color: #18212f;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  transition: background 0.15s ease, transform 0.1s ease;
}

.chess-close-btn:hover {
  background: #ffffff;
  transform: scale(1.06);
}

.chess-close-btn:active {
  transform: scale(0.94);
}
