/* ============================================================
   OVERLAYS
   ============================================================ */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(26, 26, 26, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 1.5rem;
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
}

.overlay.hidden {
  display: none;
}

/* ============================================================
   CARD
   ============================================================ */
.card {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(24px) saturate(1.6);
  -webkit-backdrop-filter: blur(24px) saturate(1.6);
  border-radius: 24px;
  box-shadow:
    0 24px 64px rgba(0,0,0,0.14),
    0 4px 16px rgba(0,0,0,0.08),
    inset 0 1px 0 rgba(255,255,255,0.9);
  padding: 2rem 1.6rem 1.6rem;
  width: 100%;
  max-width: 340px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.card h2 {
  font-family: 'Brandon Grotesque', system-ui, sans-serif;
  font-size: 1.9rem;
  line-height: 1.1;
  color: #1a1a1a;
}

.card.victory h2 { color: #1CA694; }
.card.defeat h2  { color: #F0544F; }
.card.complete h2 { color: #F7A43B; }

.card p {
  font-size: 0.95rem;
  color: #666;
  line-height: 1.45;
}

/* ============================================================
   BIG NUMBER
   ============================================================ */
.big-number {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: clamp(2.2rem, 12vw, 3.2rem);
  color: #1CA694;
  line-height: 1;
}

.card.defeat .big-number  { color: #F0544F; }
.card.complete .big-number { color: #F7A43B; }

/* ============================================================
   LEVEL BADGE + STATS
   ============================================================ */
.level-badge {
  font-family: 'Brandon Grotesque', system-ui, sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  color: #F0544F;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  opacity: 0.85;
}

.ov-stats {
  display: flex;
  justify-content: space-around;
  background: rgba(0,0,0,0.04);
  border-radius: 14px;
  padding: 0.75rem 0.5rem;
}

.ov-stats div {
  text-align: center;
}

.ov-stats .mono {
  font-size: 1rem;
  display: block;
  margin-top: 0.15rem;
}

.ov-hint {
  font-size: 0.82rem;
  color: #999;
  line-height: 1.5;
  padding: 0.6rem 0.75rem;
  background: rgba(0,0,0,0.03);
  border-radius: 12px;
}

/* Bonus display */
.bonus-line {
  font-size: 0.85rem;
  color: #F7A43B;
  font-weight: 700;
  background: rgba(247,164,59,0.08);
  border-radius: 10px;
  padding: 0.4rem 0.6rem;
}

.bonus-line.hidden { display: none; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn-primary {
  font-family: 'Brandon Grotesque', system-ui, sans-serif;
  font-size: 1.1rem;
  padding: 0.8rem 1.6rem;
  background: linear-gradient(135deg, #F0544F 0%, #ff6b6b 100%);
  color: #fff;
  border: none;
  border-radius: 16px;
  box-shadow:
    0 4px 14px rgba(240,84,79,0.35),
    inset 0 1px 0 rgba(255,255,255,0.2);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.btn-primary:active {
  transform: scale(0.96);
  box-shadow: 0 2px 8px rgba(240,84,79,0.25);
}

.btn-secondary {
  font-family: 'Brandon Grotesque', system-ui, sans-serif;
  font-size: 0.88rem;
  color: #bbb;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.2rem;
  transition: color 0.15s;
}

.btn-secondary:active { color: #888; }

/* ============================================================
   ACHIEVEMENT TOAST
   ============================================================ */
.achievement-toast {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(26,26,26,0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #fff;
  padding: 0.6rem 1.3rem;
  border-radius: 24px;
  font-size: 0.88rem;
  font-weight: 700;
  z-index: 300;
  white-space: nowrap;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  animation: toast-in-out 3s ease forwards;
}

@keyframes toast-in-out {
  0%   { opacity: 0; transform: translateX(-50%) translateY(12px); }
  12%  { opacity: 1; transform: translateX(-50%) translateY(0); }
  75%  { opacity: 1; transform: translateX(-50%) translateY(0); }
  100% { opacity: 0; transform: translateX(-50%) translateY(-8px); }
}

/* ============================================================
   DEFEAT / GAMEOVER — no blur so board + bombs stay visible
   ============================================================ */
#overlay-defeat,
#overlay-gameover {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  background: linear-gradient(to bottom, transparent 30%, rgba(26,26,26,0.72) 100%);
  align-items: flex-end;
  padding-bottom: 2rem;
}

#overlay-defeat .card,
#overlay-gameover .card {
  max-width: 420px;
  width: 100%;
}

/* ============================================================
   XRAY SELECTION MODAL
   ============================================================ */
.xray-modal {
  position: fixed;
  inset: 0;
  background: rgba(26,26,26,0.5);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 250;
  padding: 1rem;
}

.xray-modal .card {
  gap: 0.5rem;
}

.xray-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem;
}

.xray-btn {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.5rem;
  border-radius: 10px;
  background: rgba(0,0,0,0.04);
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  transition: transform 0.1s;
}

.xray-btn:active { transform: scale(0.94); }
