/* Shared modal component (portal + games) */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(3, 6, 16, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(8px);
}

.modal-overlay.show {
  opacity: 1;
  visibility: visible;
}

.modal {
  width: min(560px, 94vw);
  max-height: min(85vh, 800px);
  overflow: auto;
  padding: 32px;
  border-radius: var(--radius-lg);
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border-1);
  box-shadow: var(--shadow-lg);
  transform: scale(0.95) translateY(20px);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  backdrop-filter: blur(var(--glass-blur));
}

.modal-overlay.show .modal {
  transform: scale(1) translateY(0);
}

.modal-title {
  margin: 0 0 16px 0;
  font-size: 26px;
  font-weight: 900;
  letter-spacing: -0.03em;
  color: #fff;
  line-height: 1.2;
}

.modal-content {
  margin: 0 0 24px 0;
  color: var(--text-1);
  font-size: 16px;
  line-height: 1.7;
}

.modal-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: flex-end;
}

.modal-btn {
  border: 1px solid var(--border-1);
  background: var(--surface-1);
  color: #fff;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.modal-btn:hover {
  background: var(--surface-2);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
}

.modal-btn:active {
  transform: translateY(0);
}

.modal-btn.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border: none;
  box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

.modal-btn.primary:hover {
  box-shadow: 0 8px 25px rgba(139, 92, 246, 0.45);
}

.modal-btn.success {
  background: linear-gradient(135deg, var(--good), var(--accent-2));
  border: none;
}

.modal-btn.danger {
  background: linear-gradient(135deg, var(--bad), #f87171);
  border: none;
}

/* type accents for borders */
.modal.info {
  border-left: 4px solid var(--accent-2);
}

.modal.success {
  border-left: 4px solid var(--good);
}

.modal.warning {
  border-left: 4px solid var(--warn);
}

.modal.error {
  border-left: 4px solid var(--bad);
}

@media (max-width: 600px) {
  .modal {
    padding: 20px 16px;
    border-radius: 18px;
  }

  .modal-buttons {
    justify-content: stretch;
  }

  .modal-btn {
    flex: 1;
  }
}